[Bug 691050] Re: Daily cron job doesn't report failures
Steve Dodd
691050 at bugs.launchpad.net
Mon Jun 20 09:18:24 UTC 2022
** Patch added: "Report exit status to systemd after daily activities"
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/691050/+attachment/5598352/+files/apt.systemd.daily.patch
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/691050
Title:
Daily cron job doesn't report failures
Status in apt package in Ubuntu:
Confirmed
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,
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/691050/+subscriptions
More information about the foundations-bugs
mailing list