Don't pull in network-online.target in apt-daily.timer

Bug #1716973 reported by Julian Andres Klode
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned
Xenial
Fix Released
High
Unassigned
Zesty
Fix Committed
High
Unassigned

Bug Description

[Impact]
apt-daily.timer is enabled on every boot and pulls in network-online.target via Wants and After. While nothing has an After=apt-daily.timer (or rather an After=timers.target) and this should thus not impact boot performance, the rc-local.service specifies an After=network-online.target and the login stuff (getty, gdm, etc) is ordered After=rc-local, thus severely increasing the time to login if nothing else pulls in network-online (like an LSB script).

This works around the problem on most boots, the problem will only occur if the timer would have elapsed while the machine was off.

[Test case]
Well, the change is fairly obvious. Actually testing that is pointless, and depending on the system configuration, network-online.target might be pulled in by something else. So just look at the file and check that the network-online.target dependency moved to the service.

[Regression potential]
Literally none. We just move the dependency to the service which actually needs it.

Changed in apt (Ubuntu Xenial):
status: New → Triaged
Changed in apt (Ubuntu Zesty):
status: New → Triaged
Changed in apt (Ubuntu Xenial):
importance: Undecided → High
Changed in apt (Ubuntu Zesty):
importance: Undecided → High
Changed in apt (Ubuntu):
importance: Undecided → High
status: New → Fix Released
Changed in apt (Ubuntu Zesty):
status: Triaged → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted apt into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/1.4.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in apt (Ubuntu Zesty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-zesty
Changed in apt (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Julian, or anyone else affected,

Accepted apt into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apt/1.2.25 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Julian Andres Klode (juliank) wrote :

xenial verified:

root@eab04dbb263d:/# grep Wants /lib/systemd/system/apt-daily.timer
Wants=network-online.target
root@eab04dbb263d:/# apt install apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libapt-pkg5.0
Suggested packages:
  aptitude | synaptic | wajig dpkg-dev apt-doc python-apt
The following packages will be upgraded:
  apt libapt-pkg5.0
2 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
Need to get 1746 kB of archives.
After this operation, 1024 B disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 libapt-pkg5.0 amd64 1.2.25 [706 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 apt amd64 1.2.25 [1041 kB]
Fetched 1746 kB in 1s (923 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 6862 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.2.25_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.2.25) over (1.2.24) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Setting up libapt-pkg5.0:amd64 (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
(Reading database ... 6862 files and directories currently installed.)
Preparing to unpack .../archives/apt_1.2.25_amd64.deb ...
Unpacking apt (1.2.25) over (1.2.24) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Setting up apt (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
root@eab04dbb263d:/# grep Wants /lib/systemd/system/apt-daily.timer

tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Julian Andres Klode (juliank) wrote :

Verified on zesty:

root@d5c73dbb41a2:/# apt-cache policy apt
apt:
  Installed: 1.4.6~17.04.1
  Candidate: 1.4.8
  Version table:
     1.4.8 500
        500 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 Packages
 *** 1.4.6~17.04.1 500
        500 http://archive.ubuntu.com/ubuntu zesty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.4 500
        500 http://archive.ubuntu.com/ubuntu zesty/main amd64 Packages
root@d5c73dbb41a2:/# grep Wants /lib/systemd/system/apt-daily.timer
Wants=network-online.target
root@d5c73dbb41a2:/# apt install apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apt-doc aptitude | synaptic | wajig dpkg-dev powermgmt-base python-apt
The following packages will be upgraded:
  apt
1 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Need to get 1096 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 apt amd64 1.4.8 [1096 kB]
Fetched 1096 kB in 1s (850 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 4078 files and directories currently installed.)
Preparing to unpack .../archives/apt_1.4.8_amd64.deb ...
Unpacking apt (1.4.8) over (1.4.6~17.04.1) ...
Setting up apt (1.4.8) ...
Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
root@d5c73dbb41a2:/# grep Wants /lib/systemd/system/apt-daily.timer
root@d5c73dbb41a2:/#

tags: added: verification-done verification-done-zesty
removed: verification-needed verification-needed-zesty
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 1.2.25

---------------
apt (1.2.25) xenial; urgency=medium

  * Microrelease covering 1.4.7 (LP: #1702326) and 1.4.8

  [ Robert Luberda ]
  * fix a "critical" typo in old changelog entry (Closes: 866358)

  [ David Kalnischkies ]
  * use port from SRV record instead of initial port
  * don't ask an uninit _system for supported archs (LP: #1613184)

  [ Julian Andres Klode ]
  * Reset failure reason when connection was successful
  * http: A response with Content-Length: 0 has no content
  * apt-daily: Pull in network-online.target in service, not timer
    (LP: #1716973)

  [ Balint Reczey ]
  * Gracefully terminate process when stopping apt-daily-upgrade (LP: #1690980)

 -- Julian Andres Klode <email address hidden> Tue, 26 Sep 2017 16:14:54 +0200

Changed in apt (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for apt has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.