]> git.ipfire.org Git - thirdparty/systemd.git/commit
logind: add Halt() and CanHalt() APIs
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Oct 2017 14:03:55 +0000 (16:03 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Oct 2017 18:56:24 +0000 (20:56 +0200)
commit36b69c31312007f522a2a7ae5087ae90bd7867cc
tree324b46e3fed1d09943e05f8d72c7f9509238895b
parente65270ad1227e07659803acfba502a10d73d0ca9
logind: add Halt() and CanHalt() APIs

This adds new method calls Halt() and CanHalt() to the logind bus APIs.
They aren't overly useful (as the whole concept of halting isn't really
too useful), however they clean up one major asymmetry: currently, using
the "shutdown" legacy commands it is possibly to enqueue a "halt"
operation through logind, while logind officially doesn't actually
support this. Moreover, the path through "shutdown" currently ultimately
fails, since the referenced "halt" action isn't actually defined in
PolicyKit.

Finally, the current logic results in an unexpected asymmetry in
systemctl: "systemctl poweroff", "systemctl reboot" are currently
asynchronous (due to the logind involvement) while "systemctl halt"
isnt. Let's clean this up, and make all three APIs implemented by
logind natively, and all three hence asynchronous in "systemctl".

Moreover, let's add the missing PK action.

Fixes: #6957
src/login/logind-dbus.c
src/login/org.freedesktop.login1.conf
src/login/org.freedesktop.login1.policy.in
src/systemctl/systemctl.c