Daily cron job doesn't report failures

Bug #691050 reported by Loïc Minier on 2010-12-16
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: apt

Hi

I'm using unattended-upgrades in a lucid vm, setup for security updates to be installed automatically.

I realized recently that this stopped working for some time, but I didn't get any error whatsoever: there were available security updates when I would launch aptitude, but they would not get installed overnight anymore.

To find out what was going on, I've set APT::Periodic::Verbose 2; in the apt config; I got this output in the next day's cron:
/etc/cron.daily/apt:
verbose level 2
sleeping for 537 seconds
apt-key net-update (success)
download updated metadata (error)
download upgradable (not run)
unattended-upgrade (not run)
check_stamp: interval=0
autoclean (not run)
aged: ctime <30 and mtime <30 and ctime>2 and mtime>2
end remove by archive size: size=508 < 512000

(I found it hard to force a run, there is no flag to e.g. ignore the timestamp checks and force this cron job to do what it would do nightly; you have to edit it and disable a bunch of tests, but then it's not obvious that the right thing is being changed etc.)

The problem was that one of the APT repository I was tracking had gone away, it had been removed, resulting in apt-get update failing to complete:
E: Some index files failed to download, they have been ignored, or old ones used instead.

but this went on unnoticed for weeks.

I think this cron job should report failures by:
- outputting something meaningful to stderr when an error condition appears
- returning with a non-zero exit status when some error condition occurs

and ideally, it would be possible to run it manually during day, even if it ran overnight, perhaps a "force" flag allowing to ignore timestamp checks?

Cheers,

Loïc Minier (lool) wrote :

Oh and another thing which would be useful to disable when running the cron script by hand is the random sleep

Michael Vogt (mvo) on 2010-12-21
Changed in apt (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Loïc Minier (lool) on 2010-12-21
summary: - Daily cron job doesn't report faliures
+ Daily cron job doesn't report failures
Torsten Spindler (tspindler) wrote :

The attached patch would introduce two options to the cron job, -r for suppressing the random sleep and -u for showing usage information.

tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers