For laptop users in particular, the first run of apt-daily.service each day
is likely to occur on boot or after resume from suspend. Such a run will
fail to update package lists due to a DNS failure because of #834414. The
problem is made worse, however, because of apt's current exit code
behavior. After a failure to fetch, apt still exits with 0, and so the
apt.systemd.daily script considers it successful and touches the
update-stamp. Accordingly, all future runs of apt-daily.service that day
will check the update-stamp, see that it is recent, and abort running. So,
even if apt-daily.service has a chance to run later in the day when the
laptop is awake and network is up, it still will fail to update package
lists.

It seems that either apt's exit code behavior needs to change according to
this bug report, or if this is intended behavior then apt.systemd.daily
needs to check for DNS failure and handle it differently, in which case
perhaps a new bug report needs to be filed. Can someone advise?

When #834414 is fixed, this will not be as common of an issue, but it still
remains a separate bug as it is imaginable that the first run of
apt-daily.service in a given day could happen while DNS is down for any
number of reasons.

Reply via email to