View previous topic :: View next topic |
Author |
Message |
skiwarz Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 23 Feb 2014 Posts: 269
|
Posted: Thu Feb 13, 2025 4:00 pm Post subject: elogind does not interrupt suspend |
|
|
I'm running elogind-255.5-r2 + openrc-0.55.1. I wish to have my machine sleep after a period of time, but only if emerge or gcc is not running. In accordance with the loginctl man page, I placed a hook script in /etc/elogind/system-sleep, which checks for any emerge or gcc processes and attempts to cancel the suspend operation if they exist. I've verified that the script is indeed executed on each suspend attempt.
The problem is, my machine suspends 100% of the time.
Pertinent portion of the script: Code: | #!/bin/sh
case $1/$2 in
pre/*)
if [[ $(ps aux | grep -E "gcc|emerge" | grep -v "grep") ]]; then
echo -e "CANCELLED suspend due to my script"
exit 1
fi
;; |
The man page says I need to print an error message to STDOUT which begins with one of: "CANCELLED" "CRITICAL" "ERROR" "FAILED"
I've tried all four of these words, and in all cases the system still suspends. That piece of code IS executed, because if I redirect it to a file or run the script manually, I see it.
I've placed "AllowSuspendInterrupts=yes" in /etc/elogind/logind.conf, /etc/elogind/logind.conf.d/myconfig.conf, /etc/elogind/sleep.conf, and /etc/elogind/sleep.conf.d/mysleep.conf
Any thoughts/suggestions? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sublogic Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/92700334162390783722aa.png)
Joined: 21 Mar 2022 Posts: 312 Location: Pennsylvania, USA
|
Posted: Fri Feb 14, 2025 1:53 am Post subject: Re: elogind does not interrupt suspend |
|
|
skiwarz wrote: | I've placed "AllowSuspendInterrupts=yes" in /etc/elogind/logind.conf, /etc/elogind/logind.conf.d/myconfig.conf, /etc/elogind/sleep.conf, and /etc/elogind/sleep.conf.d/mysleep.conf | I assume elogind reads logind.conf only on startup. Did you restart the service ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
skiwarz Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 23 Feb 2014 Posts: 269
|
Posted: Fri Feb 14, 2025 6:31 am Post subject: Re: elogind does not interrupt suspend |
|
|
sublogic wrote: | skiwarz wrote: | I've placed "AllowSuspendInterrupts=yes" in /etc/elogind/logind.conf, /etc/elogind/logind.conf.d/myconfig.conf, /etc/elogind/sleep.conf, and /etc/elogind/sleep.conf.d/mysleep.conf | I assume elogind reads logind.conf only on startup. Did you restart the service ? |
Yes. In fact, I've restarted my entire machine numerous times since I began troubleshooting this, with no effect. There is also the "elogind reload" command which presumably reloads the config files without needing to restart elogind. Either way, still nothing. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|