GNU bug report logs -
#77806
elogind behavior changed: power key turns computer off
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Mon, 14 Apr 2025 16:48:02 UTC
Severity: important
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#77806: elogind behavior changed: power key turns computer off
which was filed against the guix package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 77806 <at> debbugs.gnu.org.
--
77806: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77806
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hi,
Ludovic Courtès <ludo <at> gnu.org> writes:
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> Fixes: bug#77806
>
> I would provide the complete URL, as is usually done, to avoid
> ambiguity.
Okay, done.
>> + (actions (list (shepherd-configuration-action
>> + "/etc/elogind/logind.conf"))))))
>
> Would it be possible to give the config file name in the store instead?
> That way, we would know which one is actually in effect (when one
> reconfigures, /etc/logind/logind.conf is changed through activation but
> elogind keeps honoring the previous version of it, which is why
> distinguishing between both can be helpful IMO.)
I did what you had suggested earlier with a custom
'shepherd-configuration-action' job that accepts multiple files:
--8<---------------cut here---------------start------------->8---
1 file changed, 13 insertions(+), 2 deletions(-)
gnu/services/desktop.scm | 15 +++++++++++++--
modified gnu/services/desktop.scm
@@ -1505,6 +1505,16 @@ (define (pam-extension-procedure config)
(session (cons pam-elogind (pam-service-session pam))))))
(shepherd-requirements '(elogind)))))
+(define* (shepherd-configuration-action* files)
+ "Return a 'configuration' action to display FILES, which should be the names
+of the service's configuration files."
+ (shepherd-action
+ (name 'configuration)
+ (documentation "Display the names of this service's configuration files.")
+ (procedure #~(lambda (_)
+ (format #t "~{~a~%~}" '#$files)
+ '#$files))))
+
(define (elogind-shepherd-service config)
"Return a Shepherd service to start elogind according to @var{config}."
(list (shepherd-service
@@ -1514,8 +1524,9 @@ (define (elogind-shepherd-service config)
(list #$(file-append (elogind-configuration-elogind config)
"/libexec/elogind/elogind"))))
(stop #~(make-kill-destructor))
- (actions (list (shepherd-configuration-action
- "/etc/elogind/logind.conf"))))))
+ (actions (list (shepherd-configuration-action*
+ (list (logind.conf config)
+ (sleep.conf config))))))))
(define elogind-service-type
(service-type
--8<---------------cut here---------------end--------------->8---
And it seems to work correctly on my machine:
--8<---------------cut here---------------start------------->8---
$ sudo herd configuration elogind
/gnu/store/z2hdrmyxjd0x7msf66638ppl9hx99fh3-logind.conf
/gnu/store/hqbmn9idlydkkm554k1zrhi306ffsldl-sleep.conf
maxim <at> terra ~$ cat /gnu/store/hqbmn9idlydkkm554k1zrhi306ffsldl-sleep.conf
[Sleep]
SuspendState=mem standby freeze
SuspendEstimationSec=3600
HibernateMode=platform shutdown
maxim <at> terra ~$ find /etc/elogind/
/etc/elogind/
/etc/elogind/logind.conf.d
/etc/elogind/logind.conf.d/logind.conf
/etc/elogind/sleep.conf.d
/etc/elogind/sleep.conf.d/sleep.conf
maxim <at> terra ~$ readlink /etc/elogind/logind.conf.d/logind.conf
/gnu/store/z2hdrmyxjd0x7msf66638ppl9hx99fh3-logind.conf
maxim <at> terra ~$ readlink /etc/elogind/sleep.conf.d/sleep.conf
/gnu/store/hqbmn9idlydkkm554k1zrhi306ffsldl-sleep.conf
--8<---------------cut here---------------end--------------->8---
Josselin pointed to some problem, which I've now fix (had to use
"drop-ins" files instead of the canonical config file names, which are
looked from the package's sysconfdir in the store instead of under
/etc/elogind). If we find other we can fix them later, but it seems to
me it can't be much worst than it is now, so I've now pushed this to
master, with commit f10d00e4e25.
Thanks to everyone who helped figure that one out!
--
Thanks,
Maxim
[Message part 3 (message/rfc822, inline)]
Hello,
Probably related to the elogind upgrade in
098b5cdf9c6841df0b3c086974eef7e13fd23b36, I noticed today that pressing
the power button on my laptop would turn it off instead of putting it
into software suspend as it used to do:
--8<---------------cut here---------------start------------->8---
2025-04-14 17:59:53 localhost elogind[290]: Power key pressed short.
2025-04-14 17:59:53 localhost elogind[290]: Powering off...
2025-04-14 17:59:53 localhost elogind[290]: System is powering down.
2025-04-14 17:59:54 localhost shepherd[1]: Stopping service root...
2025-04-14 17:59:54 localhost shepherd[1]: Exiting shepherd...
2025-04-14 17:59:54 localhost shepherd[1]: Stopping service swap-/swap...
2025-04-14 17:59:54 localhost shepherd[1]: Service swap-/swap stopped.
2025-04-14 17:59:54 localhost shepherd[1]: Service swap-/swap is now stopped.
--8<---------------cut here---------------end--------------->8---
Previously I had:
--8<---------------cut here---------------start------------->8---
2025-04-08 18:07:51 localhost elogind[282]: Power key pressed short.
2025-04-08 18:07:51 localhost elogind[282]: Suspending...
2025-04-08 18:07:51 localhost NetworkManager[311]: <info> [1744128471.3311] manager: sleep: sleep requested (sleeping: no enabled: yes)
2025-04-08 18:07:51 localhost NetworkManager[311]: <info> [1744128471.3332] manager: NetworkManager state is now ASLEEP
2025-04-08 18:07:51 localhost elogind[282]: Entering sleep state 'suspend'...
2025-04-08 18:07:51 localhost linux: [82930.856145] PM: suspend entry (deep)
--8<---------------cut here---------------end--------------->8---
Yet the config reads this:
--8<---------------cut here---------------start------------->8---
$ grep -i powerkey $(sudo herd configuration elogind)
HandlePowerKey=suspend
PowerKeyIgnoreInhibited=no
--8<---------------cut here---------------end--------------->8---
Thoughts?
Ludo’.
This bug report was last modified 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.