diff -Nru anacron-2.3/debian/anacron.anacron-resume.service anacron-2.3/debian/anacron.anacron-resume.service --- anacron-2.3/debian/anacron.anacron-resume.service 2014-12-28 19:14:52.000000000 +0000 +++ anacron-2.3/debian/anacron.anacron-resume.service 1970-01-01 00:00:00.000000000 +0000 @@ -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 -Nru anacron-2.3/debian/anacron.preinst anacron-2.3/debian/anacron.preinst --- anacron-2.3/debian/anacron.preinst 1970-01-01 00:00:00.000000000 +0000 +++ anacron-2.3/debian/anacron.preinst 2017-05-29 16:36:12.000000000 +0000 @@ -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 -Nru anacron-2.3/debian/anacron.service anacron-2.3/debian/anacron.service --- anacron-2.3/debian/anacron.service 2014-12-28 19:14:52.000000000 +0000 +++ anacron-2.3/debian/anacron.service 2017-05-29 16:36:12.000000000 +0000 @@ -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 -Nru anacron-2.3/debian/anacron.timer anacron-2.3/debian/anacron.timer --- anacron-2.3/debian/anacron.timer 1970-01-01 00:00:00.000000000 +0000 +++ anacron-2.3/debian/anacron.timer 2017-05-29 16:36:12.000000000 +0000 @@ -0,0 +1,10 @@ +[Unit] +Description=Trigger anacron every hour + +[Timer] +OnCalendar=hourly +RandomizedDelaySec=5m +Persistent=true + +[Install] +WantedBy=timers.target diff -Nru anacron-2.3/debian/changelog anacron-2.3/debian/changelog --- anacron-2.3/debian/changelog 2014-12-28 19:14:52.000000000 +0000 +++ anacron-2.3/debian/changelog 2021-08-31 20:58:38.000000000 +0000 @@ -1,3 +1,24 @@ +anacron (2.3-24~16.04.sav0) xenial; urgency=medium + + * Backport to Xenial + + -- Rob Savoury Tue, 31 Aug 2021 13:58:38 -0700 + +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 Mon, 29 May 2017 18:36:12 +0200 + anacron (2.3-23) unstable; urgency=medium * Team upload. diff -Nru anacron-2.3/debian/cron.d anacron-2.3/debian/cron.d --- anacron-2.3/debian/cron.d 2014-12-28 19:14:52.000000000 +0000 +++ anacron-2.3/debian/cron.d 2017-05-29 16:36:12.000000000 +0000 @@ -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 -Nru anacron-2.3/debian/rules anacron-2.3/debian/rules --- anacron-2.3/debian/rules 2014-12-28 19:14:52.000000000 +0000 +++ anacron-2.3/debian/rules 2017-05-29 16:36:12.000000000 +0000 @@ -18,14 +18,11 @@ 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