X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl%2Fsystemctl.c;h=3d59a8bb1d3b6a01918aff79e5cefc4ba65ee58a;hp=723be76cdbad6a7b168d9a2224d4677a69d5596c;hb=b85bdddafb321fa870b9250a2ff17040d6996061;hpb=23ade460e5a118daa575a961b405d089f95e0617 diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 723be76cd..3d59a8bb1 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1595,11 +1595,22 @@ static int start_unit(DBusConnection *bus, char **args) { streq(args[0], "force-reload") ? "ReloadOrTryRestartUnit" : "StartUnit"; - mode = - (streq(args[0], "isolate") || - streq(args[0], "rescue") || - streq(args[0], "emergency") || - streq(args[0], "default")) ? "isolate" : arg_job_mode; + if (streq(args[0], "isolate") || + streq(args[0], "rescue") || + streq(args[0], "emergency") || + streq(args[0], "default")) + mode = "isolate"; + else if (streq(args[0], "halt") || + streq(args[0], "poweroff") || + streq(args[0], "reboot") || + streq(args[0], "kexec") || + streq(args[0], "exit") || + streq(args[0], "suspend") || + streq(args[0], "hibernate") || + streq(args[0], "hybrid-sleep")) + mode = "replace-irreversibly"; + else + mode = arg_job_mode; one_name = table[verb_to_action(args[0])]; @@ -1614,7 +1625,7 @@ static int start_unit(DBusConnection *bus, char **args) { arg_action == ACTION_RUNLEVEL2 || arg_action == ACTION_RUNLEVEL3 || arg_action == ACTION_RUNLEVEL4 || - arg_action == ACTION_RUNLEVEL5) ? "isolate" : "replace"; + arg_action == ACTION_RUNLEVEL5) ? "isolate" : "replace-irreversibly"; one_name = table[arg_action]; }