Red Hat Bugzilla – Bug 710502
NM-wait-online.service does not wait for link up
Last modified: 2011-06-30 06:41:49 EDT
+++ This bug was initially created as a clone of Bug #703852 +++
NetworkManager-wait-online.service is not working as expected. It quits
immediately with a failure:
[ 21.703189] systemd: Job NetworkManager.service/start finished, result=done
[ 21.706765] systemd: About to execute: /usr/bin/nm-online -q -x --timeout=30
[ 21.723075] systemd: Forked /usr/bin/nm-online as 814
[ 21.726549] systemd: NetworkManager-wait-online.service changed dead -> start
[ 21.865662] r8169 0000:02:00.0: em1: link down
[ 21.868962] r8169 0000:02:00.0: em1: link down
[ 21.872380] ADDRCONF(NETDEV_UP): em1: link is not ready
[ 22.011777] systemd: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
[ 22.016442] systemd: Received SIGCHLD from PID 814 (nm-online).
[ 22.019876] systemd: Got SIGCHLD for process 814 (nm-online)
[ 22.023156] systemd: Child 814 died (code=exited, status=1/FAILURE)
[ 22.026386] systemd: Child 814 belongs to NetworkManager-wait-online.service
[ 22.029609] systemd: NetworkManager-wait-online.service: main process exited, code=exited, status=1
The link is not ready yet, therefore NM is not connecting. "-x" was
passed to nm-online, so it quits.
That's why the original NM initscript did something similar to:
ExecStart=/bin/sh -c 'nm-online -q --timeout=10 || nm-online -q -x --timeout=30'
(which is what I originally proposed for NetworkManager-wait-online.service)
The "-x" parameter was added to the service in 1:0.8.9997-1.git20110531.fc15
The '-x' is to make sure it doesn't spin excessively if NM isn't running at all - having the above wait 10 seconds seems like overkill.
(In reply to comment #2)
> The '-x' is to make sure it doesn't spin excessively if NM isn't running at all
Wouldn't that be a misconfiguration?
Would adding Requisite=NetworkManager.service to the unit file do the right thing?
(In reply to comment #3)
> (In reply to comment #2)
> > The '-x' is to make sure it doesn't spin excessively if NM isn't running at all
> Wouldn't that be a misconfiguration?
Perhaps, but I think you want enable/disable of NetworkManager.service to cause NM-wait-online.service to do the right thing. For example...
> Would adding Requisite=NetworkManager.service to the unit file do the right
No, because that would fail the transaction entirely if the admin disabled NM, but not NM-wait-online.
Created attachment 503013 [details]
(In reply to comment #4)
> (In reply to comment #3)
> > Would adding Requisite=NetworkManager.service to the unit file do the right
> > thing?
> No, because that would fail the transaction entirely if the admin disabled NM,
> but not NM-wait-online.
In my testing it works fine.
I removed the '-x', and added 'Requisite=NetworkManager.service'.
Then tested with the intentionally wrong configuration:
chkconfig network on
systemctl enable NetworkManager-wait-online.service
systemctl disable NetworkManager.service
The system boots without any trouble. In the debug log I can see NM-wait-online failing as expected and everything else is happy:
[ 2.274090] systemd: Installed new job network.service/start as 82
[ 2.274093] systemd: Installed new job network.target/start as 83
[ 2.274096] systemd: Installed new job NetworkManager-wait-online.service/start as 84
[ 2.274099] systemd: Installed new job NetworkManager.service/verify-active as 85
[ 3.202838] systemd: Job NetworkManager.service/verify-active finished, result=skipped
[ 3.202865] systemd: Job NetworkManager-wait-online.service/start finished, result=dependency
[ 3.202890] systemd: Job NetworkManager-wait-online.service/start failed with result 'dependency'.
[ 3.224272] systemd: About to execute: /etc/rc.d/init.d/network start
[ 3.231816] systemd: Forked /etc/rc.d/init.d/network as 430
[ 3.232588] systemd: network.service changed dead -> start
[ 7.510302] systemd: network.service changed start -> running
[ 7.510336] systemd: Job network.service/start finished, result=done
[ 7.517202] systemd: network.target changed dead -> active
[ 7.517212] systemd: Job network.target/start finished, result=done
Bill, after reading the previous comment, do you still have any objections to the proposed change in NetworkManager-wait-online.service?
Created attachment 505199 [details]
[PATCH] systemd: fix NetworkManager-wait-online.service to wait for link up
Dan, please apply the attached patch. Thanks.
NetworkManager-0.8.9997-4.git20110620.fc15 has been submitted as an update for Fedora 15.
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.9997-4.git20110620.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
then log in and leave karma (feedback).
NetworkManager-0.8.9997-4.git20110620.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.