summaryrefslogtreecommitdiff
path: root/src/basic/process-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-06 15:51:26 +0100
committerSven Eden <yamakuzure@gmx.net>2017-07-17 17:58:35 +0200
commitc1a072fc4997f736c2c7cd9716ea2a3973c9704a (patch)
tree23e32b237942256e54959087163d7ef3a43529f3 /src/basic/process-util.h
parent4a7059686430f596810f0c83e4897154828fd352 (diff)
util-lib: improve container detection logic
Previously, elogind-detect-virt was unable to detect "elogind-nspawn -a" container environments, i.e. where PID 1 is a stub process running in host context, as in that case /proc/1/environ was inherited from the host. Let's improve that, and add an additional check for container environments where /proc/1/environ is not cleaned up and does not contain the $container environment variable: The /proc/1/sched file shows the host PID in the first line. if this is not 1, we know we are running in a PID namespace (but not which implementation). With these changes we should be able to detect container environments that don't set $container at all.
Diffstat (limited to 'src/basic/process-util.h')
0 files changed, 0 insertions, 0 deletions