From 14669d4b95f0f6a9b215d7fa5aebbc3b7198585d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 17 Mar 2016 08:56:58 +0100 Subject: 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/rules | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index ce7d19dec..7b7df7ad9 100755 --- a/debian/rules +++ b/debian/rules @@ -222,13 +222,17 @@ apt: build-binary build-manpages debian/apt.install # debian/$@/usr/lib/apt/apt-report-mirror-failure \ # move the apt-helper in place - mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper + mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper + # install apt.systemd.daily helper in the right place + install -m755 debian/apt.systemd.daily debian/$@/usr/lib/apt/ dh_bugfiles -p$@ dh_lintian -p$@ dh_installexamples -p$@ $(BLD)/docs/examples/* dh_installman -p$@ $(wildcard $(patsubst %,doc/en/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES))) - dh_installcron -p$@ + dh_installcron -p$@ --name=apt-compat + dh_systemd_enable -p$@ apt-daily.timer + dh_systemd_start -p$@ apt-daily.timer dh_installdocs -p$@ dh_installchangelogs -p$@ dh_installlogrotate -p$@ -- cgit v1.2.3