-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust timing of daily apt tasks #5853
Conversation
I'm trying this out applied manually as part of RC3 testing (don't wanna wait overnight to see if it's applied) and it does not appear to trigger updates or upgrades. I think |
That's surprising. All it does is change the schedule of the timers. I don't know why it would require other configuration changes. |
https://wiki.debian.org/UnattendedUpgrades describes the timer format in a bit of detail but it's describing a case where you want to move the daily run from 6,1800 with a randomized delay of 12 hours to 1am precisely, and what actually happens is that the timer triggers apt-daily.service, which checks the delta between now and its last runtime against the interval defined in the APT::Periodic::* values above, and only actually does something if said delta is bigger than the interval. So! in order to be able to trigger updates and upgrades (which are 2 separate timers) arbitrarily, you'd need to set those APT::Periodic:: values to "always", which appears to be a keyword meaning "always run when asked", which the developers probably had to add because "0" can't mean "0 interval" as it already means "don't ever run". |
@zenmonkeykstop Where are you seeing that "always" is a permissible value? For |
Docs are a little sparse, it's true. The apt.conf man page will redirect you to /usr/lib//apt/apt.systemd.dailywhich documents the N for N days or 0 for off behaviour. But if you grep for "always" in said script you will find the Most |
On further review/discussion - we can get the desired test behaviour (rerunning |
Builds on the work by @rmol in #5853. Slots in overrides to the apt-daily{,-upgrade} timers, shipped with the 'apt' package, to provide fine-grained control over the update and reboot times. Ensures that the apt lists are updated approximately 1h prior to the package upgrade. Lowered the time-fuzzing to 20m on each action, so that even at the extremes, there's still a 20m window for an apt update to complete. Uses a modulus to determine the sooner update time.
Builds on the work by @rmol in #5853. Slots in overrides to the apt-daily{,-upgrade} timers, shipped with the 'apt' package, to provide fine-grained control over the update and reboot times. Ensures that the apt lists are updated approximately 1h prior to the package upgrade. Lowered the time-fuzzing to 20m on each action, so that even at the extremes, there's still a 20m window for an apt update to complete. Uses a modulus to determine the sooner update time.
closing in favor of #5855 |
Builds on the work by @rmol in #5853. Slots in overrides to the apt-daily{,-upgrade} timers, shipped with the 'apt' package, to provide fine-grained control over the update and reboot times. Ensures that the apt lists are updated approximately 1h prior to the package upgrade. Lowered the time-fuzzing to 20m on each action, so that even at the extremes, there's still a 20m window for an apt update to complete. Uses a modulus to determine the sooner update time. (cherry picked from commit 34fdc7a)
Status
Work in progress (timing needs to honor
sdconfig
options)Description of Changes
Fixes #5851.
Adjusts the timing of the
apt-daily
systemd
timer so that updates are downloaded about every three hours.Adjusts the timing of the
apt-daily-upgrade
timer so that the updates are applied at a random time between 0400 and 0500.Testing
make build-debs-focal && make staging-focal
override.conf
file is present in both of:/etc/systemd/system/apt-daily.timer.d
/etc/systemd/system/apt-daily-upgrade.timer.d
CalendarOn
andRandomizedDelaySec
entries in those files match what's reported by:systemctl show apt-daily.timer
systemctl show apt-daily-upgrade.timer
Deployment
This should ensure that updates are more reliably noticed and applied every day.
Checklist
If you made changes to the system configuration:
If you made non-trivial code changes:
Choose one of the following: