Hi Peter, I've just uploaded anacron 2.3-24 to DELAYED/3 with the following changes:
> anacron (2.3-24) unstable; urgency=medium > > * Team upload. > * Reference anacron and anacrontab man page in anacron.service > * Use native systemd timer unit to trigger anacron periodically. > When running under systemd, use a native timer unit which triggers > anacron.service every hour. If the system was suspended for more then > one hour, the timer will activate immediately on resume. The timer uses > a randomized delay of up to 5 minutes. This helps with not overloading > the system when coming out of suspend. > Drop anacron-resume.service, as this service is no longer necessary. > (Closes: #744753) > > -- Michael Biebl <[email protected]> Mon, 29 May 2017 18:36:12 +0200 I've attached the debdiff as well. Peter, let me know, if you are not happy with this upload, so we can cancel it or if you are fine with uploading without DELAY. Once the upload is made, I will push the changes to Git as well. I haven't changed the SysV code path (yet), which still relies on hooks to be triggered on resume as I wanted to keep the changes as minimal as possible this late into the freeze. We might eventually consolidate the two approaches and use the patch from Laurent in [1], which drops all hooks and runs anacron every hour for SysV as well. Something for buster, I'd say. Regards, Michael [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744753#78 -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
diff --git a/debian/anacron.anacron-resume.service b/debian/anacron.anacron-resume.service deleted file mode 100644 index 21b840a..0000000 --- a/debian/anacron.anacron-resume.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Run anacron jobs at resume -After=suspend.target -After=hibernate.target -After=hybrid-sleep.target - -[Service] -ExecStart=/bin/systemctl --no-block --fail start anacron.service - -[Install] -WantedBy=suspend.target -WantedBy=hibernate.target -WantedBy=hybrid-sleep.target - diff --git a/debian/anacron.preinst b/debian/anacron.preinst new file mode 100644 index 0000000..603d3b4 --- /dev/null +++ b/debian/anacron.preinst @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if dpkg --compare-versions "$2" lt-nl 2.3-24; then + deb-systemd-helper purge anacron-resume.service >/dev/null + deb-systemd-helper unmask anacron-resume.service >/dev/null +fi + +#DEBHELPER# diff --git a/debian/anacron.service b/debian/anacron.service index 77af569..46450c3 100644 --- a/debian/anacron.service +++ b/debian/anacron.service @@ -2,6 +2,7 @@ Description=Run anacron jobs After=time-sync.target ConditionACPower=true +Documentation=man:anacron man:anacrontab [Service] ExecStart=/usr/sbin/anacron -dsq diff --git a/debian/anacron.timer b/debian/anacron.timer new file mode 100644 index 0000000..8a04eb4 --- /dev/null +++ b/debian/anacron.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Trigger anacron every hour + +[Timer] +OnCalendar=hourly +RandomizedDelaySec=5m +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/debian/changelog b/debian/changelog index 997e12e..f223e76 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +anacron (2.3-24) unstable; urgency=medium + + * Team upload. + * Reference anacron and anacrontab man page in anacron.service + * Use native systemd timer unit to trigger anacron periodically. + When running under systemd, use a native timer unit which triggers + anacron.service every hour. If the system was suspended for more then + one hour, the timer will activate immediately on resume. The timer uses + a randomized delay of up to 5 minutes. This helps with not overloading + the system when coming out of suspend. + Drop anacron-resume.service, as this service is no longer necessary. + (Closes: #744753) + + -- Michael Biebl <[email protected]> Mon, 29 May 2017 18:36:12 +0200 + anacron (2.3-23) unstable; urgency=medium * Team upload. diff --git a/debian/cron.d b/debian/cron.d index 1691ffe..505b5c7 100644 --- a/debian/cron.d +++ b/debian/cron.d @@ -3,4 +3,4 @@ SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null +30 7 * * * root [ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi diff --git a/debian/rules b/debian/rules index 0f161df..5d44cc4 100755 --- a/debian/rules +++ b/debian/rules @@ -18,14 +18,11 @@ override_dh_auto_install: install -D -m 755 debian/apm.d debian/anacron/etc/apm/event.d/anacron install -D -m 755 debian/pm-utils.power.d debian/anacron/usr/lib/pm-utils/power.d/anacron install -D -m 755 debian/pm-utils.sleep.d debian/anacron/usr/lib/pm-utils/sleep.d/95anacron + install -D -m 644 debian/anacron.timer debian/anacron/lib/systemd/system/anacron.timer override_dh_installcron: dh_installcron dh_installcron --name=0anacron -override_dh_systemd_enable: - dh_systemd_enable anacron.service - dh_systemd_enable --name anacron-resume - override_dh_installinit: dh_installinit --no-start
signature.asc
Description: OpenPGP digital signature

