]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/systemctl/systemctl.c
systemctl: restore "systemctl reboot ARG" functionality
authorVesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Sat, 9 Mar 2019 20:30:45 +0000 (22:30 +0200)
committerVesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Fri, 22 Mar 2019 15:38:54 +0000 (17:38 +0200)
commit77defcf5382a557189350f928967d676510e362c
tree883732c4d081c2d382a4858deef0b4deab65dff0
parent9b89e602ea7be5d8c08a4019b67016fa58d0341d
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
src/core/emergency-action.c
src/shared/reboot-util.c
src/shared/reboot-util.h
src/systemctl/systemctl.c