[Bug 1667769] Re: apt-daily.service running too early in boot process
Julian Andres Klode
jak at jak-linux.org
Fri Jun 2 12:22:39 UTC 2017
This was fixed in 1.4.2 (and the 1.3.? and 1.2.? SRUs) but I forgot to
mention the bug in the changelog. Aargh.
** Changed in: apt (Ubuntu)
Status: Triaged => Fix Released
--
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/1667769
Title:
apt-daily.service running too early in boot process
Status in apt package in Ubuntu:
Fix Released
Bug description:
System: ubuntu mate 16.04 with apt version 1.2.19
Problem:
On a desktop system I noticed that the package lists were being
updated very infrequently. This is apparently because on most days the
apt-daily.service is triggered early in the boot process when the
network is not up. Since the timer is set to run approximately every
12 hours, and the system is only on for a few days, the timer tends to
lapse over night and is then triggered as soon as the system is booted
the following day.
Also, `apt-get update` returns true regardless of whether there is a
network connection, so the apt.systemd.daily script reports success
and updates the timestamp file regardless. This means that if the
system is only used for a few hours per day the package list may not
be updated for many days until the timer lapses while the system
happens to be already switched on.
System journal showing typical output during boot process:
Feb 10 14:38:13 desktop systemd[1]: Starting Daily apt activities...
Feb 10 14:38:13 desktop apt.systemd.daily[3679]: verbose level 3
...
[truncated]
...
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: + apt-get -y update
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Temporary failure resolving 'security.ubuntu.com'
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Err:2 http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial InRelease
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Temporary failure resolving 'ppa.launchpad.net'
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Err:3 http://gb.archive.ubuntu.com/ubuntu xenial InRelease
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Temporary failure resolving 'gb.archive.ubuntu.com'
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Err:4 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Temporary failure resolving 'gb.archive.ubuntu.com'
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Err:5 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease
Feb 10 14:38:14 desktop apt.systemd.daily[3679]: Temporary failure resolving 'gb.archive.ubuntu.com'
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: Reading package lists...
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary fa
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temp
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Te
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Tempo
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Failed to fetch http://ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu/dists/xenial/InR
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: W: Some index files failed to download. They have been ignored, or old ones used instead.
Feb 10 14:38:17 desktop apt.systemd.daily[3679]: + debug_echo download updated metadata (success).
Work-around:
I have worked around this by creating a file /etc/systemd/system/apt-
daily.service.d/network.conf containing the following options:
Wants=network-online.target
After=network-online.target
Maybe there is a better way to specify unit dependencies or to edit
the timer so it will delay on startup, but this seems to fix the issue
for me.
Related bug:
This other bug might be related, but it states that it causes apt-get to hang indefinitely, which I have not seen on my system.
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1636049
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1667769/+subscriptions
More information about the foundations-bugs
mailing list