Bug 45865 - NetworkManager hangs on shutdown
Summary: NetworkManager hangs on shutdown
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: high normal
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 22:45 UTC by Michael Biebl
Modified: 2012-02-10 15:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Biebl 2012-02-09 22:45:19 UTC
I think this started around v39:
When I shutdown/reboot the system, the shutdown procedure hangs when trying to stop the NetworkManager service.
The last message I see is
Stopped Network Manager.

Then the shutdown process hangs for about 60secs.
I noticed that dbus.service is already stopping before the NetworkManager.service has been fully stopped.

As a work-around, I added a Requires/After=dbus.service to NetworkManager.service
After that, the system shutdown properly again.
Comment 1 Michael Biebl 2012-02-09 23:28:10 UTC
The messages on shutdown look like

Stopping Network Manager...                                                    
Stopping D-Bus System Message Bus...                                           
Stopped Network Manager                                                [  OK  ]
(60 sec timeout)
Stopped D-Bus System Message Bus     

As this is not 100% reproducible, I suspect there is a race.
If NM is quick enough to shut down before D-Bus is shutting down, everything is fine. Otherwise we run into the timeout.
Comment 2 Michael Biebl 2012-02-10 03:22:44 UTC
I was kindly pointed to Michal's commit [1], and this indeed fixed the hang on shutdown. Apparently, the problem was that when NM died because of dbus going away, it was not correctly noticed.

So while this particular issue has been fixed, it has shown the underlying problem, that the shutdown ordering is not correct.

dbus.service should not be stopped as long as not all (dbus type)services have been shutdown properly.


[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=5c72face73e89610a5b926c42fc8e0223bf546a2
Comment 3 Lennart Poettering 2012-02-10 15:29:57 UTC
Fixed in git.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.