diff -u anacron-2.3/debian/changelog anacron-2.3/debian/changelog --- anacron-2.3/debian/changelog +++ anacron-2.3/debian/changelog @@ -1,4 +1,12 @@ -anacron (2.3-13.1ubuntu2) intrepid; urgency=low +anacron (2.3-13.1ubuntu3) intrepid; urgency=low + + * debian/pm-utils.d: + - install pm-utils hook that starts/stops anacron on + suspend/resume (LP: #249220) + + -- Michael Vogt Mon, 28 Jul 2008 13:44:52 +0200 + +cdanacron (2.3-13.1ubuntu2) intrepid; urgency=low * Demote anacron's Recommends of mail-transport-agent to a Suggests; since we've been doing fine without an MTA in the desktop for some diff -u anacron-2.3/debian/dirs anacron-2.3/debian/dirs --- anacron-2.3/debian/dirs +++ anacron-2.3/debian/dirs @@ -14,2 +14,3 @@ usr/share/man/man8 +usr/lib/pm-utils/sleep.d/ var/spool/anacron diff -u anacron-2.3/debian/rules anacron-2.3/debian/rules --- anacron-2.3/debian/rules +++ anacron-2.3/debian/rules @@ -41,6 +41,8 @@ install -m 755 debian/acpi.d.resume debian/anacron/etc/acpi/ac.d/85-anacron.sh install -m 755 debian/acpi.d.suspend debian/anacron/etc/acpi/suspend.d/15-anacron.sh install -m 755 debian/acpi.d.suspend debian/anacron/etc/acpi/battery.d/15-anacron.sh + # pm-utils + install -m 755 debian/pm-utils.d debian/anacron/usr/lib/pm-utils/sleep.d/95anacron touch install-stamp # Build architecture-independent files here. only in patch2: unchanged: --- anacron-2.3.orig/debian/pm-utils.d +++ anacron-2.3/debian/pm-utils.d @@ -0,0 +1,24 @@ +#! /bin/sh + +# This script makes anacron jobs start to run when the machine is +# woken up. For a laptop, these are the closest parallels to turning +# on a desktop. + +# The /etc/init.d/anacron script now normally tries to avoid running +# anacron unless on AC power, so as to avoid running down the battery. +# (Things like the slocate updatedb cause a lot of IO.) Rather than +# trying to second-guess which events reflect having or not having +# power, we just try to run anacron every time and let it abort if +# there's no AC. You'll see a message on the cron syslog facility +# (typically /var/log/cron) if it does run. + +. /usr/lib/pm-utils/functions + +case "$1" in + resume|thaw) + /usr/sbin/invoke-rc.d anacron start >/dev/null + ;; + suspend|hibernate) + /usr/sbin/invoke-rc.d anacron stop >/dev/null + ;; +esac