Systemd timers in suspend

Any hint on how I can prevent systemd timers from running when in suspend? My F39 workstation will not survive a day in suspend on battery because the timers will wake it up and battery gets drained… Regardless of the WakeSystem=false settings.

sudo systemctl list-timers --all
NEXT                          LEFT LAST                        PASSED UNIT                         ACTIVATES                     
Tue 2023-11-28 17:03:26 CET  13min -                                - systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Tue 2023-11-28 17:12:20 CET  22min -                                - dnf-makecache.timer          dnf-makecache.service
Wed 2023-11-29 00:00:00 CET     7h Tue 2023-11-28 13:17:05 CET      - logrotate.timer              logrotate.service
Wed 2023-11-29 00:00:00 CET     7h Tue 2023-11-28 13:17:05 CET      - unbound-anchor.timer         unbound-anchor.service
Wed 2023-11-29 05:21:02 CET    12h Tue 2023-11-28 14:35:17 CET      - plocate-updatedb.timer       plocate-updatedb.service
Sun 2023-12-03 01:00:00 CET 4 days Sun 2023-11-26 14:22:47 CET      - raid-check.timer             raid-check.service
Mon 2023-12-04 00:29:00 CET 5 days Mon 2023-11-27 17:20:37 CET      - fstrim.timer                 fstrim.service

All three timers from 2023-11-28 should have not got started as the system was suspended.

I can’t speak for your system, but in general, systemd timers don’t wake up a suspended system (it is possible on some hardware if they include WakeSystem=true, but none of these timers do).

Are you certain that your system wakes up exactly when the next timer is scheduled? Perhaps it wakes up for a different reason at a different time?

If it wakes up “randomly” (not related to systemd timers activation time), it’s a power management issue. On some systems I had to configure /proc/acpi/wakeup to disable certain events (like USB ports) from sending wake up calls, to work around some bugs.

If it wakes up exactly when the next systemd timer is due, then please report a bug into RH bugzilla against systemd, and let see what systemd developers say.

1 Like

oh, right, so it’s most likely a hw component that wakes it up and the timers just run as scheduled… I’ll have to do better investigation here…
Thanks for pointing me to the right direction!