chiark / gitweb /
dbus: allow all clients access to org.freedesktop.DBus.Peer
[elogind.git] / src / main.c
index 4bdc6763fabf83546407b784ecb9b51c4c4654d7..d1eeffb12ee0b23f70d1af1686bed0e22f3e7bf1 100644 (file)
@@ -49,6 +49,7 @@
 #include "missing.h"
 #include "label.h"
 #include "build.h"
+#include "strv.h"
 
 static enum {
         ACTION_RUN,
@@ -72,6 +73,7 @@ static bool arg_sysv_console = true;
 static bool arg_mount_auto = true;
 static bool arg_swap_auto = true;
 static char *arg_console = NULL;
+static char **arg_default_controllers = NULL;
 
 static FILE* serialization = NULL;
 
@@ -502,6 +504,7 @@ static int parse_config_file(void) {
                 { "CPUAffinity", config_parse_cpu_affinity, NULL,               "Manager" },
                 { "MountAuto",   config_parse_bool,         &arg_mount_auto,    "Manager" },
                 { "SwapAuto",    config_parse_bool,         &arg_swap_auto,     "Manager" },
+                { "DefaultControllers", config_parse_strv,  &arg_default_controllers, "Manager" },
                 { NULL, NULL, NULL, NULL }
         };
 
@@ -896,7 +899,7 @@ static void test_mtab(void) {
         if (readlink_malloc("/etc/mtab", &p) >= 0) {
                 bool b;
 
-                b = streq(p, "/proc/self/mounts");
+                b = streq(p, "/proc/self/mounts") || streq(p, "/proc/mounts");
                 free(p);
 
                 if (b)
@@ -982,6 +985,11 @@ int main(int argc, char *argv[]) {
         if (parse_argv(argc, argv) < 0)
                 goto finish;
 
+        /* If Plymouth is being run make sure we show the status, so
+         * that there's something nice to see when people press Esc */
+        if (access("/dev/.systemd/plymouth", F_OK) >= 0)
+                arg_show_status = true;
+
         if (arg_action == ACTION_HELP) {
                 retval = help();
                 goto finish;
@@ -1089,6 +1097,9 @@ int main(int argc, char *argv[]) {
         if (arg_console)
                 manager_set_console(m, arg_console);
 
+        if (arg_default_controllers)
+                manager_set_default_controllers(m, arg_default_controllers);
+
         if ((r = manager_startup(m, serialization, fds)) < 0)
                 log_error("Failed to fully start up daemon: %s", strerror(-r));
 
@@ -1211,6 +1222,7 @@ finish:
 
         free(arg_default_unit);
         free(arg_console);
+        strv_free(arg_default_controllers);
 
         dbus_shutdown();