]> git.saurik.com Git - apt.git/commit - debian/apt.maintscript
Use systemd.timer instead of a cron job
authorMichael Vogt <mvo@ubuntu.com>
Thu, 17 Mar 2016 07:56:58 +0000 (08:56 +0100)
committerMichael Vogt <mvo@debian.org>
Fri, 1 Apr 2016 11:02:39 +0000 (13:02 +0200)
commit14669d4b95f0f6a9b215d7fa5aebbc3b7198585d
treef22ee5dda27ea2a6fb3ee7bf07a553fbb5cd3d41
parent6a4958d3134a3a61c036bc9ccaccc393c2bb99f2
Use systemd.timer instead of a cron job

The rational is that we need to spread the load on the mirrors
that apt update and unattended-upgrades cause. To do so, we
leverage the RandomizeDelay feature of systemd. The other advantage
is that the timer is not run at a fixed daily.daily time but
instead every 24h. This also fixes the problem that the randomized
deplay in the current apt.cron.daily causes other cron jobs to
be deplayed.

A compatibility cron job is also provided for systems that do not
use systemd.

Note that the time is fired two times a day, but the logic inside
of apt.systemd.daily will ensure (via stamp files) that the
servers are hit at most every 24h. Firing two times a day helps
with the worst case update time and it also helps with systems
that are not always on.

LP: #246381, #727685
Closes: #600262, #709675, #663290
debian/apt-daily.service [new file with mode: 0644]
debian/apt-daily.timer [new file with mode: 0644]
debian/apt.apt-compat.cron.daily [new file with mode: 0644]
debian/apt.cron.daily [deleted file]
debian/apt.dirs
debian/apt.install.in
debian/apt.maintscript
debian/apt.systemd.daily [new file with mode: 0644]
debian/control
debian/rules