runs to early, causes dependency loops
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pollinate (Ubuntu) |
Fix Released
|
Critical
|
Martin Pitt | ||
Trusty |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Critical
|
Martin Pitt | ||
Yakkety |
Fix Released
|
Critical
|
Martin Pitt |
Bug Description
The first half of the original bug report got fixed in bug 1578833, but pollinate still runs to early.
SRU INFORMATION
===============
Impact: Causes service failures during boot when using NFS mounts, regression from bug 1578833
Reproducer:
- sudo apt-get install -y nfs-common pollinate
- echo "1.2.3.4:/foo /mnt nfs defaults,nofail 0 0" | sudo tee -a /etc/fstab
(This will start network-
- sudo reboot
- Confirm that "sudo journalctl -b -p warning" shows a dependency loop, and most probably "systemctl status network-
- Upgrade to the proposed pollinate update, reboot.
- Confirm that there is no dependency loop any more and "systemctl status network-
- Confirm that "systemctl status pollinate" is "enabled" (it will have "start: condition failed", but that is intended).
- Confirm that /etc/systemd/
Regression potential: Low. This merely changes when pollinate.service gets activated, and network.target is too early (nothing should actually be started by network.target, this is mostly meant for shutdown). The main thing that can go wrong is that the upgrade still leaves the old /etc/systemd/
Original bug report:
pollinate runs too early on some of the instances i launch. Basically nothing guarantees that it will have network access when it attempts to run.
failure looks something like:
$ lxc launch xenial x1
$ sleep 4
$ lxc exec x1 systemctl status pollinate
● pollinate.service - Seed the pseudo random number generator on first boot
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Thu 2016-04-28 17:16:03 UTC; 1min 17s ago
Process: 86 ExecStart=
Main PID: 86 (code=exited, status=0/SUCCESS)
Apr 28 17:16:03 ubuntu systemd[1]: Starting Seed the pseudo random number generator on first boot...
Apr 28 17:16:03 ubuntu pollinate[106]: client sent challenge to [https:/
Apr 28 17:16:03 ubuntu pollinate[86]: <13>Apr 28 17:16:03 pollinate[86]: client sent challenge to [https:/
Apr 28 17:16:03 ubuntu pollinate[149]: [432B blob data]
Apr 28 17:16:03 ubuntu pollinate[86]: Apr 28 17:16:03 ubuntu <13>Apr 28 17:16:03 pollinate[86]: WARNING: Network communication failed [0]\n % Total % Received % Xferd Average Speed Time Time Time Current
Apr 28 17:16:03 ubuntu pollinate[86]: Dload Upload Total Spent Left Speed
Apr 28 17:16:03 ubuntu pollinate[86]: [139B blob data]
Apr 28 17:16:03 ubuntu pollinate[86]: 17:16:03.859980 * Closing connection 0
Apr 28 17:16:03 ubuntu pollinate[86]: curl: (6) Could not resolve host: entropy.ubuntu.com
Apr 28 17:16:03 ubuntu systemd[1]: Started Seed the pseudo random number generator on first boot.
This seems like it might work:
# diff -u /lib/systemd/
--- /lib/systemd/
+++ /lib/systemd/
@@ -2,6 +2,7 @@
Description=Seed the pseudo random number generator on first boot
DefaultDepende
After=
+After=
Before=ssh.service
[Service]
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: pollinate 4.15-0ubuntu1 [modified: usr/bin/pollinate]
ProcVersionSign
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Thu Apr 28 16:39:17 2016
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
SourcePackage: pollinate
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
description: | updated |
description: | updated |
Changed in pollinate (Ubuntu Yakkety): | |
status: | In Progress → Fix Committed |
Changed in pollinate (Ubuntu Xenial): | |
status: | Triaged → In Progress |
> +After= network. target
network.target is mostly just relevant for a correct shutdown order, thus it's irrelevant. You want "After= network- online. target" instead (see man systemd.special). But if you do this, you have to give up on running this during early boot (DefaultDepende ncies=no) as the networking can only be brought up much later.
While we are on cleaning up the unit, pollinate.service has
[Install] network. target
WantedBy=
while this is harmless (as long as you don't also specify Before= network. target) , it's misleading to a reader. Better hook it into multi-user.target.