chiark / gitweb /
virt: rework container detection logic
authorLennart Poettering <lennart@poettering.net>
Wed, 28 May 2014 10:37:11 +0000 (18:37 +0800)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 May 2014 10:53:44 +0000 (18:53 +0800)
Instead of accessing /proc/1/environ directly, trying to read the
$container variable from it, let's make PID 1 save the contents of that
variable to /run/systemd/container. This allows us to detect containers
without the need for CAP_SYS_PTRACE, which allows us to drop it from a
number of daemons and from the file capabilities of systemd-detect-virt.

Also, don't consider chroot a container technology anymore. After all,
we don't consider file system namespaces container technology anymore,
and hence chroot() should be considered a container even less.


No differences found