When we moved the time to 1 minute after the timer would've elapsed, systemd could pick RandomizedDelaySec= <= 1 minute which would then cause the timer to elapse immediately and the InactiveExitTimestamp= to get recalculated including a new next elapse time that would be for the next "window": systemd[1]: timer-RandomizedDelaySec-30785.timer: Adding 3.634672s random time. systemd[1]: timer-RandomizedDelaySec-30785.timer: Realtime timer elapses at Fri 2025-11-07 00:10:03 UTC. systemd[1]: timer-RandomizedDelaySec-30785.timer: Timer elapsed. systemd[1]: timer-RandomizedDelaySec-30785.timer: Changed waiting -> running systemd[1]: Found unit timer-RandomizedDelaySec-30785.timer at /run/systemd/system/timer-RandomizedDelaySec-30785.timer (regular file) systemd[1]: Preset files say disable timer-RandomizedDelaySec-30785.timer. systemd[1]: timer-RandomizedDelaySec-30785.timer: Got notified about unit deactivation. systemd[1]: timer-RandomizedDelaySec-30785.timer: Adding 8h 39min 26.166418s random time. systemd[1]: timer-RandomizedDelaySec-30785.timer: Realtime timer elapses at Sat 2025-11-08 08:49:26 UTC. systemd[1]: timer-RandomizedDelaySec-30785.timer: Changed running -> waiting ... TEST-53-TIMER.sh[1008]: InactiveExitTimestamp=Thu 2025-11-06 23:00:00 UTC TEST-53-TIMER.sh[1010]: ++ systemctl show -P NextElapseUSecRealtime timer-RandomizedDelaySec-30785.timer TEST-53-TIMER.sh[905]: + NEXT_ELAPSE_REALTIME='Sat 2025-11-08 08:49:26 UTC' TEST-53-TIMER.sh[1011]: ++ date '--date=Sat 2025-11-08 08:49:26 UTC' +%s TEST-53-TIMER.sh[905]: + NEXT_ELAPSE_REALTIME_S=1762591766 TEST-53-TIMER.sh[905]: + : 'Next elapse timestamp should be Fri 2025-11-07 00:10:00 UTC <= Sat 2025-11-08 08:49:26 UTC <= Fri 2025-11-07 22:10:00 UTC' TEST-53-TIMER.sh[905]: + assert_ge 1762591766 1762474200 TEST-53-TIMER.sh[1012]: + set +ex TEST-53-TIMER.sh[905]: + assert_le 1762591766 1762553400 TEST-53-TIMER.sh[1013]: + set +ex TEST-53-TIMER.sh[1013]: FAIL: '1762591766' > '1762553400' Technically, the race is still there, but the window for it should be _much_ smaller now (< 1s on a reasonably fast system). Let's hope that's enough. Resolves: #39594
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS
