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)
committerRaspbian forward porter <root@raspbian.org>
Sat, 13 Jul 2019 01:30:09 +0000 (02:30 +0100)
commit6c6d2da529f4c57543cefdb3f7f9633933714a12
tree44e31dc62694a6b6f300929c3f5ff94529ec9b1e
parenteea12a9f6a6682ff93e0ceeff37639638eeeabbd
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
(cherry picked from commit 77defcf5382a557189350f928967d676510e362c)

Gbp-Pq: Name systemctl-restore-systemctl-reboot-ARG-functionality.patch
src/core/emergency-action.c
src/shared/reboot-util.c
src/shared/reboot-util.h
src/systemctl/systemctl.c