LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   elogind 255.4 ignores HandlePowerKey option (https://www.linuxquestions.org/questions/slackware-14/elogind-255-4-ignores-handlepowerkey-option-4175735987/)

af7567 04-13-2024 02:26 PM

elogind 255.4 ignores HandlePowerKey option
 
..at least that's what seems to be happening.
I have had
Code:

HandlePowerKey=suspend-then-hibernate
for a long time but after updating today the power key just powers off which is the default.
No error messages are shown in the logs, the only thing I see is
Code:

Apr 13 18:20:37 elogind-daemon[1213]: Power key pressed short.
Apr 13 18:20:37 elogind-daemon[1213]: Powering off...
Apr 13 18:20:37 elogind-daemon[1213]: System is powering down.

So it looks like elogind is actually still handling the power key, but just using the default value instead of what is in /etc/elogind/logind.conf

business_kid 04-13-2024 02:49 PM

There's a bugfix release elogind-255.4-r1 that fixes stuff. This thread applies

af7567 04-13-2024 03:52 PM

I did see that -r1 release on github but the changes didn't seem to apply to my problem so I didn't build it. I just built it now though, and it doesn't fix the problem.
I downloaded and built 252.23-r1 from github and built that, and now my config works again - but after resume the network is broken.

From the 255.4 changelog 3 days ago:
Quote:

The sleep/hibernation part has its own sleep.conf now.
I guess that is what caused the problem. So I need to figure out if it's a bug in elogind or do I just need to update my config :)
Although that is sleep.conf, but the setting is from logind.conf.
~~Maybe I just need to move it.....~~ Nope, moving the settings to sleep.conf just give a warning that the key is not recognized in the Sleep section.

af7567 04-14-2024 07:38 AM

It looks like logind.conf and logind.conf.d don't get parsed at all in version 255.4. Even if I put incorrect values in the files elogind doesn't complain. It only mentions the sleep.conf files.

af7567 04-14-2024 08:35 AM

I have found the difference between reading logind.conf and sleep.conf files. When reading logind.conf it prepends PKGSYSCONFDIR to the logind.conf file name which prevents it from finding it. Not sure if this is a problem with the slackbuild or a bug in the code.
I added
Code:

sed -i 's#logind_conf = PKGSYSCONFDIR "/#logind_conf = "#' src/login/logind-core.c
To the SlackBuild and then it reads the config OK.

I have opened an issue here: https://github.com/elogind/elogind/issues/279

af7567 04-16-2024 09:07 AM

The patch to fix reading of logind.conf has been applied to elogind upstream now which fixes this issue


All times are GMT -5. The time now is 04:41 AM.