[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#820850: apt.systemd.daily: option to loop until apt-get update succeeds



Package: apt
Version: 1.2.10
Severity: wishlist

I normally have the patch below applied to my /etc/cron.daily/apt file,
which causes the apt cron job to loop until apt-get update succeeds.
The switch to a systemd timer means I have to patch the file after
every update since it is in /usr instead of in /etc. So it would be
nice to have an option to enable this behaviour. The reason I added it
is that when apt fails to update due to hash sum mismatches or
whatever, sometimes it completely forgets about packages from the
missing/broken suite and the loop mitigates this in my experience.

--- a/etc/cron.daily/apt
+++ b/etc/cron.daily/apt
@@ -456,7 +456,7 @@
 UPDATED=0
 UPDATE_STAMP=/var/lib/apt/periodic/update-stamp
 if check_stamp $UPDATE_STAMP $UpdateInterval; then
-    if eval apt-get $XAPTOPT -y update $XSTDERR; then
+    if eval while ! apt-get $XAPTOPT -y update $XSTDERR \; do sleep 1m \; done ; then
 	debug_echo "download updated metadata (success)."
 	if which dbus-send >/dev/null 2>&1 && pidof dbus-daemon >/dev/null 2>&1; then
 	    if dbus-send --system / app.apt.dbus.updated boolean:true ; then

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: