diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-10-02 16:03:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-10-04 20:56:24 +0200 |
commit | 36b69c31312007f522a2a7ae5087ae90bd7867cc (patch) | |
tree | 324b46e3fed1d09943e05f8d72c7f9509238895b /src/login/org.freedesktop.login1.policy.in | |
parent | e65270ad1227e07659803acfba502a10d73d0ca9 (diff) | |
download | systemd-36b69c31312007f522a2a7ae5087ae90bd7867cc.tar.gz |
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
Diffstat (limited to 'src/login/org.freedesktop.login1.policy.in')
-rw-r--r-- | src/login/org.freedesktop.login1.policy.in | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in index 66cbce393c..3e8a9bbe3f 100644 --- a/src/login/org.freedesktop.login1.policy.in +++ b/src/login/org.freedesktop.login1.policy.in @@ -218,6 +218,39 @@ <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate> </action> + <action id="org.freedesktop.login1.halt"> + <_description>Halt the system</_description> + <_message>Authentication is required for halting the system.</_message> + <defaults> + <allow_any>auth_admin_keep</allow_any> + <allow_inactive>auth_admin_keep</allow_inactive> + <allow_active>auth_admin_keep</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.set-wall-message</annotate> + </action> + + <action id="org.freedesktop.login1.halt-multiple-sessions"> + <_description>Halt the system while other users are logged in</_description> + <_message>Authentication is required for halting the system while other users are logged in.</_message> + <defaults> + <allow_any>auth_admin_keep</allow_any> + <allow_inactive>auth_admin_keep</allow_inactive> + <allow_active>auth_admin_keep</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.halt</annotate> + </action> + + <action id="org.freedesktop.login1.halt-ignore-inhibit"> + <_description>Halt the system while an application asked to inhibit it</_description> + <_message>Authentication is required for halting the system while an application asked to inhibit it.</_message> + <defaults> + <allow_any>auth_admin_keep</allow_any> + <allow_inactive>auth_admin_keep</allow_inactive> + <allow_active>auth_admin_keep</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.halt</annotate> + </action> + <action id="org.freedesktop.login1.suspend"> <_description>Suspend the system</_description> <_message>Authentication is required for suspending the system.</_message> |