diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-06 15:51:26 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-12-14 18:29:30 +0100 |
commit | 8d6e80343a1463afbaed1beca4b18c49ce056034 (patch) | |
tree | 7ddaad8f563df86791d7b0ea309f566cfc4ff3c4 /units/proc-sys-fs-binfmt_misc.automount | |
parent | f6f372d2f46ac9be7cbb1ecd8f82f1b3ab669924 (diff) |
util-lib: improve container detection logic
Previously, systemd-detect-virt was unable to detect "systemd-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 'units/proc-sys-fs-binfmt_misc.automount')
0 files changed, 0 insertions, 0 deletions