[systemd-commits] 3 commits - src/core

Lennart Poettering lennart at kemper.freedesktop.org
Thu Mar 21 20:45:28 PDT 2013


 src/core/main.c        |   16 +++++-----------
 src/core/mount-setup.c |    1 +
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 3cbb76ee3469998771b4e9c7ee85d8d7407a2f5a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Mar 22 04:42:48 2013 +0100

    mount: mount all cgroup controllers in containers, too

diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 6140f56..fe50fb1 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -315,6 +315,7 @@ int mount_cgroup_controllers(char ***join_controllers) {
                 p.type = "cgroup";
                 p.options = options;
                 p.flags = MS_NOSUID|MS_NOEXEC|MS_NODEV;
+                p.mode = MNT_IN_CONTAINER;
 
                 r = mount_one(&p, true);
                 free(controller);

commit db813c2a9199d694f8e97618889425a2401524d6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Mar 22 04:42:26 2013 +0100

    main: use strv_find() where we can

diff --git a/src/core/main.c b/src/core/main.c
index 21c0d27..05f0803 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1310,19 +1310,13 @@ int main(int argc, char *argv[]) {
         /* Determine if this is a reexecution or normal bootup. We do
          * the full command line parsing much later, so let's just
          * have a quick peek here. */
-        for (j = 1; j < argc; j++)
-                if (streq(argv[j], "--deserialize")) {
-                        skip_setup = true;
-                        break;
-                }
+        if (strv_find(argv+1, "--deserialize"))
+                skip_setup = true;
 
         /* If we have switched root, do all the special setup
          * things */
-        for (j = 1; j < argc; j++)
-                if (streq(argv[j], "--switched-root")) {
-                        skip_setup = false;
-                        break;
-                }
+        if (strv_find(argv+1, "--switched-root"))
+                skip_setup = false;
 
         /* If we get started via the /sbin/init symlink then we are
            called 'init'. After a subsequent reexecution we are then

commit e2b1eb2661e95c8e3d03c5f7183a234fea990b68
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Mar 22 04:40:05 2013 +0100

    main: don't mount cgroup controller unless PID == 1
    
    This completes c1dae1b3c9729fb8ab749dd4e2dad07e0fad7ed8 in a way.

diff --git a/src/core/main.c b/src/core/main.c
index 01a6d41..21c0d27 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1582,7 +1582,7 @@ int main(int argc, char *argv[]) {
         if (getpid() == 1)
                 install_crash_handler();
 
-        if (geteuid() == 0 && !getenv("SYSTEMD_SKIP_API_MOUNTS")) {
+        if (getpid() == 1) {
                 r = mount_cgroup_controllers(arg_join_controllers);
                 if (r < 0)
                         goto finish;



More information about the systemd-commits mailing list