X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=05f0803b8bb81550a22d2050b426c89ec9d36e3b;hb=8e70580bb07ae46dc0b0bf377de6333540668acc;hp=01a6d41fb4c7d9ade192db5acfb76c5c5e443640;hpb=c1dae1b3c9729fb8ab749dd4e2dad07e0fad7ed8;p=elogind.git diff --git a/src/core/main.c b/src/core/main.c index 01a6d41fb..05f0803b8 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 @@ -1582,7 +1576,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;