X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=installer%2Ffunctions.sh;h=f27b4535b28284dfd8f968ba1a88832d960d28a1;hb=89c66bc7389a037231eebc0085bb1d083aaac469;hp=02b061d81999e470370ff250f46db194c4dbe7a5;hpb=4578337079b223e94c4a4b2442015786de136ec2;p=netdata.git diff --git a/installer/functions.sh b/installer/functions.sh index 02b061d8..f27b4535 100644 --- a/installer/functions.sh +++ b/installer/functions.sh @@ -265,8 +265,8 @@ iscontainer() { # /proc/1/sched exposes the host's pid of our init ! # http://stackoverflow.com/a/37016302 - local pid=$( cat /proc/1/sched | head -n 1 | { IFS='(),#:' read name pid th threads; echo $pid; } ) - local p=$(( pid + 0 )) + local pid=$( cat /proc/1/sched 2>/dev/null | head -n 1 | { IFS='(),#:' read name pid th threads; echo $pid; } ) + pid=$(( pid + 0 )) [ ${pid} -ne 1 ] && return 0 # lxc sets environment variable 'container'