1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-02 04:22:27 +03:00

timer: introduce DeferReactivation setting

By default, in instances where timers are running on a realtime schedule,
if a service takes longer to run than the interval of a timer, the
service will immediately start again when the previous invocation finishes.
This is caused by the fact that the next elapse is calculated based on
the last trigger time, which, combined with the fact that the interval
is shorter than the runtime of the service, causes that elapse to be in
the past, which in turn means the timer will trigger as soon as the
service finishes running.

This behavior can be changed by enabling the new DeferReactivation setting,
which will cause the next calendar elapse to be calculated based on when
the trigger unit enters inactivity, rather than the last trigger time.

Thus, if a timer is on an realtime interval, the trigger will always
adhere to that specified interval.
E.g. if you have a timer that runs on a minutely interval, the setting
guarantees that triggers will happen at *:*:00 times, whereas by default
this may skew depending on how long the service runs.

Co-authored-by: Matteo Croce <teknoraver@meta.com>
This commit is contained in:
Arthur Shau
2024-03-14 12:43:13 -07:00
committed by Matteo Croce
parent 632407c3e4
commit cc0ab8c810
10 changed files with 56 additions and 8 deletions

View File

@ -387,6 +387,7 @@ Most timer unit settings are available to transient units.
✓ AccuracySec=
✓ RandomizedDelaySec=
✓ FixedRandomDelay=
✓ DeferReactivation=
Unit=
```