mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
commit
cd88f98bf9
1 changed files with 4 additions and 4 deletions
|
@ -234,14 +234,14 @@ def _is_inside_container():
|
||||||
Returns True or False
|
Returns True or False
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# See https://stackoverflow.com/a/37016302
|
# See https://www.2daygeek.com/check-linux-system-physical-virtual-machine-virtualization-technology/
|
||||||
p = subprocess.Popen("sudo cat /proc/1/sched".split(),
|
p = subprocess.Popen("sudo systemd-detect-virt".split(),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
out, _ = p.communicate()
|
out, _ = p.communicate()
|
||||||
|
container = ['lxc','lxd','docker']
|
||||||
return out.split()[1] != "(1,"
|
return out.split()[0] in container
|
||||||
|
|
||||||
|
|
||||||
def tools_postinstall(domain, password, ignore_dyndns=False):
|
def tools_postinstall(domain, password, ignore_dyndns=False):
|
||||||
|
|
Loading…
Add table
Reference in a new issue