chiark / gitweb /
systemctl: use isolate when called as telinit for a runlevel
authorLennart Poettering <lennart@poettering.net>
Tue, 14 Sep 2010 00:22:55 +0000 (02:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 14 Sep 2010 00:22:55 +0000 (02:22 +0200)
src/initctl.c
src/systemctl.c

index 53eac57..15da459 100644 (file)
@@ -119,7 +119,7 @@ static void change_runlevel(Server *s, int runlevel) {
         else
                 mode = "replace";
 
         else
                 mode = "replace";
 
-        log_debug("Running request %s", target);
+        log_debug("Running request %s/start/%s", target, mode);
 
         if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnit"))) {
                 log_error("Could not allocate message.");
 
         if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnit"))) {
                 log_error("Could not allocate message.");
index 627b905..1f93bc9 100644 (file)
@@ -1254,7 +1254,11 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
                 method = "StartUnit";
 
                 mode = (arg_action == ACTION_EMERGENCY ||
                 method = "StartUnit";
 
                 mode = (arg_action == ACTION_EMERGENCY ||
-                        arg_action == ACTION_RESCUE) ? "isolate" : "replace";
+                        arg_action == ACTION_RESCUE ||
+                        arg_action == ACTION_RUNLEVEL2 ||
+                        arg_action == ACTION_RUNLEVEL3 ||
+                        arg_action == ACTION_RUNLEVEL4 ||
+                        arg_action == ACTION_RUNLEVEL5) ? "isolate" : "replace";
 
                 one_name = table[arg_action];
         }
 
                 one_name = table[arg_action];
         }