about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-08-07 22:42:46 +0200
committerJuan RP <xtraeme@gmail.com>2014-08-07 22:42:46 +0200
commit8ccf1fc36be503d4b6ed9dfb7f45cd289cc0763f (patch)
tree6c582de2b7788197a0d9751fda3c67fd4a387996
parent3ae68e920ded86f5915df3a6cdadd750e38675ba (diff)
downloadrunit-void-8ccf1fc36be503d4b6ed9dfb7f45cd289cc0763f.tar.gz
runit-void-8ccf1fc36be503d4b6ed9dfb7f45cd289cc0763f.tar.xz
runit-void-8ccf1fc36be503d4b6ed9dfb7f45cd289cc0763f.zip
functions: detect_virt: do nothing if /proc/self/environ does not exist.
-rw-r--r--[-rwxr-xr-x]functions3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions b/functions
index 65d0b78..3ab0f1c 100755..100644
--- a/functions
+++ b/functions
@@ -28,7 +28,8 @@ emergency_shell() {
 }
 
 detect_virt() {
-    # Detect LXC containers
+   # Detect LXC containers
+   [ ! -e /proc/self/environ ] && return
    if grep -q lxc /proc/self/environ >/dev/null; then
        export VIRTUALIZATION=1
    fi