Bug 710502 - NM-wait-online.service does not wait for link up
NM-wait-online.service does not wait for link up
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
15
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-03 11:06 EDT by Michal Schmidt
Modified: 2011-06-30 06:41 EDT (History)
11 users (show)

See Also:
Fixed In Version: NetworkManager-0.8.9997-4.git20110620.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 703852
Environment:
Last Closed: 2011-06-23 23:55:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
modified NetworkManager-wait-online.service (256 bytes, text/plain)
2011-06-04 16:13 EDT, Michal Schmidt
no flags Details
[PATCH] systemd: fix NetworkManager-wait-online.service to wait for link up (1.28 KB, patch)
2011-06-17 03:26 EDT, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Michal Schmidt 2011-06-03 11:06:04 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[1]: Job NetworkManager.service/start finished, result=done
[   21.706765] systemd[1]: About to execute: /usr/bin/nm-online -q -x --timeout=30
[   21.723075] systemd[1]: Forked /usr/bin/nm-online as 814
[   21.726549] systemd[1]: 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[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on /org/freedesktop/DBus
[   22.016442] systemd[1]: Received SIGCHLD from PID 814 (nm-online).
[   22.019876] systemd[1]: Got SIGCHLD for process 814 (nm-online)
[   22.023156] systemd[1]: Child 814 died (code=exited, status=1/FAILURE)
[   22.026386] systemd[1]: Child 814 belongs to NetworkManager-wait-online.service
[   22.029609] systemd[1]: 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)
Comment 1 Michal Schmidt 2011-06-03 11:09:23 EDT
The "-x" parameter was added to the service in 1:0.8.9997-1.git20110531.fc15
Comment 2 Bill Nottingham 2011-06-03 11:56:47 EDT
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.
Comment 3 Michal Schmidt 2011-06-03 12:34:15 EDT
(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?
Comment 4 Bill Nottingham 2011-06-03 14:17:56 EDT
(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
> thing?

No, because that would fail the transaction entirely if the admin disabled NM, but not NM-wait-online.
Comment 5 Michal Schmidt 2011-06-04 16:13:20 EDT
Created attachment 503013 [details]
modified NetworkManager-wait-online.service

(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
  reboot

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[1]: Installed new job network.service/start as 82
[    2.274093] systemd[1]: Installed new job network.target/start as 83
[    2.274096] systemd[1]: Installed new job NetworkManager-wait-online.service/start as 84
[    2.274099] systemd[1]: Installed new job NetworkManager.service/verify-active as 85
...
[    3.202838] systemd[1]: Job NetworkManager.service/verify-active finished, result=skipped
[    3.202865] systemd[1]: Job NetworkManager-wait-online.service/start finished, result=dependency
[    3.202890] systemd[1]: Job NetworkManager-wait-online.service/start failed with result 'dependency'.
...
[    3.224272] systemd[1]: About to execute: /etc/rc.d/init.d/network start
[    3.231816] systemd[1]: Forked /etc/rc.d/init.d/network as 430
[    3.232588] systemd[1]: network.service changed dead -> start
...
[    7.510302] systemd[1]: network.service changed start -> running
[    7.510336] systemd[1]: Job network.service/start finished, result=done
[    7.517202] systemd[1]: network.target changed dead -> active
[    7.517212] systemd[1]: Job network.target/start finished, result=done
Comment 6 Michal Schmidt 2011-06-14 05:09:37 EDT
Bill, after reading the previous comment, do you still have any objections to the proposed change in NetworkManager-wait-online.service?
Comment 7 Bill Nottingham 2011-06-14 14:15:15 EDT
No.
Comment 8 Michal Schmidt 2011-06-17 03:26:31 EDT
Created attachment 505199 [details]
[PATCH] systemd: fix NetworkManager-wait-online.service to wait for  link up

Dan, please apply the attached patch. Thanks.
Comment 9 Jirka Klimes 2011-06-17 08:06:33 EDT
Pushed: ffbb7df4b85c68aafe4578750a1f78fc9d734fb8
Thanks!
Comment 10 Fedora Update System 2011-06-20 21:07:46 EDT
NetworkManager-0.8.9997-4.git20110620.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-4.git20110620.fc15
Comment 11 Fedora Update System 2011-06-21 19:53:18 EDT
Package NetworkManager-0.8.9997-4.git20110620.fc15:
* 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:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-4.git20110620.fc15
then log in and leave karma (feedback).
Comment 12 Fedora Update System 2011-06-23 23:55:31 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.