Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Avoiding having calendar-interval timers run during boot/wakeup #5659
Comments
julian-klode
commented
Mar 29, 2017
|
Anacron imposed a 5 minute delay on catching up with daily jobs during boot, maybe it makes sense to follow that, but I'm not entirely convinced. I should note that this only really affects users without an SSD. Maybe it makes sense to run any catch-up stuff after reaching the login screen, though. That to me sounds like it makes a lot more sense than imposing an arbitrary magic delay, and is actually a proper design. |
poettering
added
pid1
RFE
labels
Mar 29, 2017
|
The same issue with fstrim timer (OnCalendar=weekly) https://bugzilla.redhat.com/show_bug.cgi?id=1442537 It has pretty bad impact to the boot time... I think we need postpone OnCalendars at all or add option to specify delay after boot
or so... |
julian-klode
commented
Apr 18, 2017
|
@karelzak I'm surprised the RH bug is mentioning RandomizedDelaySec as a work around. We have RandomizedDelaySec=12h in apt's timer and that makes no difference. Just doing what anacron does (5m) is probably the safest option. |
fhuberts
commented
Apr 19, 2017
|
@julian-klode 'RandomizedDelaySec' is the closest I could find, but wasn't able to actually test it yet... |
hedayat
commented
Aug 11, 2017
|
This is my finding about RandomizedDelaySec; The bug also affects (very badly) mlocate in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1282232 |
hedayat
commented
Aug 11, 2017
|
I prefer the delay to be user controllable rather than a fixed one (e.g. 5min). Or maybe RandomizedDelaySec should be also applied (in addition to the fixed time) when an outdated timer is going to be started too. |
zackw commentedMar 29, 2017
Submission type
NOTE: Do not submit anything other than bug reports or RFEs via the issue tracker!
systemd version the issue has been seen with
Used distribution
Feature request
If an
OnCalendartimer has its deadline expire while the computer is suspended or powered off, systemd will run the timer immediately upon wakeup or power-on. Sometimes this is exactly what you want, but for daily background jobs (e.g. distribution package index updates) there is no particular urgency and you would rather not have them add additional resource contention. (See Debian bug #844453 for a detailed example scenario.)Can we please have a mechanism for specifying that OnCalendar timers should not run within some interval of some other event (such as boot)?
(Note that systemd-tmpfiles-clean.timer seems to have been written specifically to avoid this issue, using OnBootSec+OnActiveSec, which means that a laptop that spends most of its time suspended will not get its temporary files cleaned for much longer than was probably the intent.)