apt-daily.service running too early in boot process
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
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.
...
[truncated]
...
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:14 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Feb 10 14:38:17 desktop apt.systemd.
Work-around:
I have worked around this by creating a file /etc/systemd/
Wants=network-
After=network-
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:/
Status changed to 'Confirmed' because the bug affects multiple users.