[systemd-commits] src/core

Lennart Poettering lennart at kemper.freedesktop.org
Thu Mar 14 13:39:15 PDT 2013


 src/core/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c1dae1b3c9729fb8ab749dd4e2dad07e0fad7ed8
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 14 21:36:38 2013 +0100

    main: don't mount /sys, /dev and friends when we run with PID != 1
    
    Back from old times when we developed systemd on non-systemd hosts we
    still mounted the missing directories such as the cgroup stuff even when
    running with a PID != 1. There's no point for that anymore, so let's
    just do that if we are actually PID 1, and never otherwise.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=62354

diff --git a/src/core/main.c b/src/core/main.c
index 7b03983..01a6d41 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1437,7 +1437,7 @@ int main(int argc, char *argv[]) {
 
         /* Mount /proc, /sys and friends, so that /proc/cmdline and
          * /proc/$PID/fd is available. */
-        if (geteuid() == 0 && !getenv("SYSTEMD_SKIP_API_MOUNTS")) {
+        if (getpid() == 1) {
                 r = mount_setup(loaded_policy);
                 if (r < 0)
                         goto finish;



More information about the systemd-commits mailing list