]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: simplify halt_main()
authorLudwig Nussel <ludwig.nussel@suse.de>
Tue, 14 Dec 2021 16:27:05 +0000 (17:27 +0100)
committerLudwig Nussel <ludwig.nussel@suse.de>
Tue, 25 Jan 2022 13:52:09 +0000 (14:52 +0100)
commitadefc8789b63225662e50ceaa282f9553b5c64eb
tree93a01a33e851b199d9af8319bf743227b02d21ff
parent90b1ec03b2ce939f589239133a32f4429f2ad6a6
systemctl: simplify halt_main()

The code at this point is not able to tell whether it was called as
halt/poweroff/reboot or shutdown with time "now".
The code also takes a shortcut to skip logind if called as root.
That however means asking shutdown for immediate action won't trigger a
wall message.
As per https://github.com/systemd/systemd/issues/8424#issuecomment-374677315
all commands should trigger a wall message.
That simplifies the code as we can try logind first always.
src/systemctl/systemctl-compat-halt.c