1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-07 21:18:41 +03:00
systemd/test/fuzz/fuzz-unit-file/tmpfiles-clean.timer
Arthur Shau cc0ab8c810 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>
2024-10-11 22:54:16 +02:00

43 lines
881 B
SYSTEMD

timer
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Daily Cleanup of Temporary Directories
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
[Timer]
OnBootSec=15min
OnUnitActiveSec=1d
OnBootSec=1s
OnStartupSec=234
OnUnitActiveSec=2y
OnUnitInactiveSec=23434
OnCalendar=minutely
OnCalendar=*-*-* *:*:00
OnCalendar=hourly
OnCalendar=*-*-* *:00:00
OnCalendar=daily
OnCalendar=*-*-* 00:00:00
OnCalendar=monthly
OnCalendar=*-*-01 00:00:00
OnCalendar=weekly
OnCalendar=Mon *-*-* 00:00:00
OnCalendar=yearly
OnCalendar=*-01-01 00:00:00
OnCalendar=quarterly
OnCalendar=*-01,04,07,10-01 00:00:00
OnCalendar=semiannually
OnCalendar=*-01,07-01 00:00:00
OnCalendar=Fri 2012-11-23 11:12:13
Persistent=true
AccuracySec=24h
RandomizedDelaySec=234234234
FixedRandomDelay=true
DeferReactivation=true
Persistent=no
Unit=foo.service
WakeSystem=false
RemainAfterElapse=true