summaryrefslogtreecommitdiff
path: root/src/core/emergency-action.c
diff options
context:
space:
mode:
authorVesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>2019-03-09 22:30:45 +0200
committerVesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>2019-03-22 17:38:54 +0200
commit77defcf5382a557189350f928967d676510e362c (patch)
tree883732c4d081c2d382a4858deef0b4deab65dff0 /src/core/emergency-action.c
parent9b89e602ea7be5d8c08a4019b67016fa58d0341d (diff)
downloadsystemd-77defcf5382a557189350f928967d676510e362c.tar.gz
systemctl: restore "systemctl reboot ARG" functionality
Commit d85515edcf9700dc068201ab9f7103f04f3b25b2 changed logic how reboot is executed. That commit changed behavior to use emergency action reboot code path to perform the reboot. This inadvertently broke rebooting with argument: $ systemctl reboot custom-reason Restore original behavior so that if reboot service unit similar to systemd-reboot.service is executed it is possible to override reboot reason with "systemctl reboot ARG". When "systemctl reboot ARG" is executed ARG is placed in file /run/systemd/reboot-param and reboot is issued using logind's Reboot dbus-service. If RebootArgument is specified in systemd-reboot.service it takes precedence over what systemctl sets. Fixes: #11828
Diffstat (limited to 'src/core/emergency-action.c')
-rw-r--r--src/core/emergency-action.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/emergency-action.c b/src/core/emergency-action.c
index 9731aef5c4..09f8d74092 100644
--- a/src/core/emergency-action.c
+++ b/src/core/emergency-action.c
@@ -47,7 +47,7 @@ void emergency_action(
case EMERGENCY_ACTION_REBOOT:
log_and_status(m, warn, "Rebooting", reason);
- (void) update_reboot_parameter_and_warn(reboot_arg);
+ (void) update_reboot_parameter_and_warn(reboot_arg, true);
(void) manager_add_job_by_name_and_warn(m, JOB_START, SPECIAL_REBOOT_TARGET, JOB_REPLACE_IRREVERSIBLY, NULL);
break;
@@ -55,7 +55,7 @@ void emergency_action(
case EMERGENCY_ACTION_REBOOT_FORCE:
log_and_status(m, warn, "Forcibly rebooting", reason);
- (void) update_reboot_parameter_and_warn(reboot_arg);
+ (void) update_reboot_parameter_and_warn(reboot_arg, true);
m->objective = MANAGER_REBOOT;
break;