chiark / gitweb /
logind: add Halt() and CanHalt() APIs
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Oct 2017 14:03:55 +0000 (16:03 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 8 Dec 2017 06:30:24 +0000 (07:30 +0100)
commitdfa9a97253a144ff90e64d271e6d02dec6a2ebad
tree9e1695845519d0f01c2a16ec78a4a16f17ab8111
parent7cd8f97c73ef8e5d6f6734683b4e597307a2cb7c
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