From 06a70b918d4d753769a727239f75af8896006467 Mon Sep 17 00:00:00 2001 From: Mantas Mikulėnas Date: Mon, 8 Aug 2016 11:07:38 +0300 Subject: Revert "logind: really handle *KeyIgnoreInhibited options in logind.conf" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8121f4d209eca85dcb11830800483cdfafbef9b7. The special 'key handling' inhibitors should always work regardless of any *IgnoreInhibited settings – otherwise they're nearly useless. Reverts: #3470 Fixes: #3897 --- src/login/logind-action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 8ef48dbaa1..a950409254 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -85,7 +85,7 @@ int manager_handle_action( } /* If the key handling is inhibited, don't do anything */ - if (!ignore_inhibited && inhibit_key > 0) { + if (inhibit_key > 0) { if (manager_is_inhibited(m, inhibit_key, INHIBIT_BLOCK, NULL, true, false, 0, NULL)) { log_debug("Refusing operation, %s is inhibited.", inhibit_what_to_string(inhibit_key)); return 0; -- cgit v1.2.3-54-g00ecf From 05b2a8fd7a0533758d2f532df798cabc3c442683 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sun, 14 Aug 2016 16:27:59 -0400 Subject: man: explain that *KeyIgnoreInhibited only apply to a subset of locks Follow-up for #3924. --- man/logind.conf.xml | 42 ++++++++++++++++++++++++++---------------- man/systemd-inhibit.xml | 2 +- man/systemd-logind.service.xml | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/man/logind.conf.xml b/man/logind.conf.xml index adba5a4131..5931832996 100644 --- a/man/logind.conf.xml +++ b/man/logind.conf.xml @@ -211,7 +211,7 @@ HandleLidSwitch= HandleLidSwitchDocked= - Controls whether logind shall handle the + Controls how logind shall handle the system power and sleep keys and the lid switch to trigger actions such as system power-off or suspend. Can be one of ignore, @@ -240,7 +240,16 @@ docking station, or if more than one display is connected, the action specified by HandleLidSwitchDocked= occurs; otherwise the HandleLidSwitch= - action occurs. + action occurs. + + A different application may disable logind's handling of system power and + sleep keys and the lid switch by taking a low-level inhibitor lock + ("handle-power-key", "handle-suspend-key", "handle-hibernate-key", + "handle-lid-switch"). This is most commonly used by graphical desktop environments + to take over suspend and hibernation handling, and to use their own configuration + mechanisms. If a low-level inhibitor lock is taken, logind will not take any + action when that key or switch is triggered and the Handle*= + settings are irrelevant. @@ -249,21 +258,22 @@ HibernateKeyIgnoreInhibited= LidSwitchIgnoreInhibited= - Controls whether actions triggered by the - power and sleep keys and the lid switch are subject to - inhibitor locks. These settings take boolean arguments. If - no, the inhibitor locks taken by - applications in order to block the requested operation are - respected. If yes, the requested operation - is executed in any case. + Controls whether actions that systemd-logind + takes when the power and sleep keys and the lid switch are triggered are subject + to high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor + locks ("handle-*-key"), are always honoured, irrespective of this setting. + + These settings take boolean arguments. If no, the + inhibitor locks taken by applications are respected. If yes, + "shutdown", "sleep", and "idle" inhibitor locks are ignored. PowerKeyIgnoreInhibited=, - SuspendKeyIgnoreInhibited= and - HibernateKeyIgnoreInhibited= default to - no. - LidSwitchIgnoreInhibited= defaults to - yes. This means that the lid switch does - not respect suspend blockers by default, but the power and - sleep keys do. + SuspendKeyIgnoreInhibited=, and + HibernateKeyIgnoreInhibited= default to no. + LidSwitchIgnoreInhibited= defaults to yes. + This means that when systemd-logind is handling events by + itself (no low level inhibitor locks are taken by another application), the lid + switch does not respect suspend blockers by default, but the power and sleep keys + do. diff --git a/man/systemd-inhibit.xml b/man/systemd-inhibit.xml index 9d85908f97..ce169960d8 100644 --- a/man/systemd-inhibit.xml +++ b/man/systemd-inhibit.xml @@ -61,7 +61,7 @@ Description systemd-inhibit may be used to execute a - program with a shutdown, sleep or idle inhibitor lock taken. The + program with a shutdown, sleep, or idle inhibitor lock taken. The lock will be acquired before the specified command line is executed and released afterwards. diff --git a/man/systemd-logind.service.xml b/man/systemd-logind.service.xml index 5733e42cd1..f0bdb1c756 100644 --- a/man/systemd-logind.service.xml +++ b/man/systemd-logind.service.xml @@ -84,7 +84,7 @@ management - User sessions are registered in logind via the + User sessions are registered with logind via the pam_systemd8 PAM module. -- cgit v1.2.3-54-g00ecf