deragon / autopoweroff

Manage automatic poweroff and other actions (suspend / custom) when specific conditions are reunited.
GNU General Public License v2.0
52 stars 7 forks source link

autopoweroffd dosn't come back after suspend to RAM [lmde 5] #35

Closed it-jonas closed 2 years ago

it-jonas commented 2 years ago

Hello, it seems like that the daemon doesn't comes back after suspend to disk.

user@bigbox:~$ date
Di 14. Jun 10:20:08 CEST 2022
user@bigbox:~$ sudo systemctl status autopoweroff.service 
● autopoweroff.service - LSB: Start daemon at boot time
     Loaded: loaded (/etc/init.d/autopoweroff; generated)
     Active: active (exited) since Tue 2022-06-14 10:12:47 CEST; 7min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 3492 ExecStart=/etc/init.d/autopoweroff start (code=exited, status=0/SUCCESS)
        CPU: 296ms

Jun 14 10:12:48 bigbox autopoweroffd[3500]:   ✘ Last event time happened over 0.0 mins, lower than configuration IdleTime parameter set to 1 mins.
Jun 14 10:12:48 bigbox autopoweroffd[3500]:   ✓ Resources are meeting conditions (CPU check disabled).
Jun 14 10:12:56 bigbox autopoweroffd[1069]: Shutdown completed.  Process PID #1069 is no more.
Jun 14 10:13:48 bigbox autopoweroffd[3500]: Conditions have changed.  New conditions:
Jun 14 10:13:48 bigbox autopoweroffd[3500]:   ✓ Currently out of 'No ActionTimeRange'.
Jun 14 10:13:48 bigbox autopoweroffd[3500]:   ✓ Last event time happened over 1.0 mins, greater than configuration IdleTime parameter set to 1 mins.
Jun 14 10:13:48 bigbox autopoweroffd[3500]:   ✓ Resources are meeting conditions (CPU check disabled).
Jun 14 10:13:48 bigbox autopoweroffd[3500]: All the conditions are met for running the action.
Jun 14 10:14:07 bigbox autopoweroffd[3500]: Graceful shutdown initiated.  Please wait around 30s.
Jun 14 10:14:21 bigbox autopoweroffd[3500]: Graceful shutdown initiated.  Please wait around 30s.
user@bigbox:~$ sudo ps ax  |  grep -w "[a]utopoweroffd"

Right now I solve this quick and dirty with a cron

*/1 * * * *  ps ax | grep -qw "[a]utopoweroffd" || systemctl restart autopoweroff.service

I'm seeing this problem on a lmde 5 device.

deragon commented 2 years ago

Fixed with commit 00248df89233b04c26bc10cfda37005838974401.