long delay at shutdown/reboot - network-manager doesn't close correctly

Bug #869635 reported by Lucazade
430
This bug affects 98 people
Affects Status Importance Assigned to Milestone
isc-dhcp (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre
modemmanager (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre
network-manager (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre
wpasupplicant (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre

Bug Description

I've noticed the shutdown and reboot in oneiric is slower than in natty. This is reproducible on different machines with fresh installations.

Disabling plymouth and vt.handoff=7 I can see that some processes are not closed:
* Asking all remaining processes to terminate... [OK]
* Killing all remaining processes... [fail]

Killing network-manager at runlevel6, after the dbus shutdown signal, makes the shutdown and restart really faster (I'd say 5/10sec on low end machines like netbooks)

--- /etc/init/network-manager.conf.orig 2010-05-03 14:56:09.745071317 +0200
+++ /etc/init/network-manager.conf 2010-05-03 14:56:43.075152939 +0200
@@ -8,6 +8,7 @@
 start on (local-filesystems
          and started dbus)
 stop on stopping dbus
+stop on runlevel [06]

 expect fork
 respawn

after applying this I get no more errors:
* Killing all remaining processes... [OK]

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Harry (harry33) wrote :

I can confirm this bug.

After this:
"killing all remaining processes ... [fail]"
there is this warning:
"nmdispatcher.action caught signal 15 shutting down ..."

This happens with all my three different (64-bit, 32-bit, Nvidia, AMD, Intel) setups.

Revision history for this message
Harry (harry33) wrote :

Also confirming the workaround
adding the line:
stop on runlevel [6]
into the file /etc/init/network-manager.conf
fixes this issue.

Revision history for this message
dino99 (9d9) wrote :

Confirm the same issue on oneiric i386 logged as gnome-classic

* Asking all remaining processes to terminate... [OK]
* Killing all remaining processes... [fail]

asking for remaining processes seems to hang (maybe a timeout)

Revision history for this message
Harald Rudell (harald-rudell) wrote :

If I insert "stop on runlevel [6]" into /etc/init/network-manager.conf on a Lenovo S10-3t,
I get many error messages after Killing all remaining..:

modem-manager[n]: <info> Modem Manager (version 0.5) starting...
modem-manager[n]: Could not get the system bus. Make sure the message bus daemon is running! Message: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused

Revision history for this message
Dan Johnson (daniel-johnson-5) wrote :

I inserted this code into /etc/init/network-manager.conf and it didn't change my shutdown dialogue or speed. I'm running Lubuntu on a Dell Latitude i686 with a SSD, and had the same problem with Xubuntu on my machine prior to this install.

Revision history for this message
Bonzer (bonzer) wrote :

I got the same errors as Harald after trying the above. It was still very slow to shutdown and sometimes didn't shutdown at all.

The only way I could previously get it to shutdown reliably was with a "sudo shutdown -h now".

I have now found if I remove the network manager it completely fixes it. I now have no errors and quick shutdown.

sudo apt-get remove network-manager

If I re-install the above network manager, the problem comes back. So that is definitely the cause in my case.

I have installed "wicd" as a replacement network manager. I did this before removing the Ubuntu supplied network manager.

I am using 11.10 that has been upgraded from 11.04. I have wired ethernet.

Revision history for this message
valdi (informatyk74) wrote :

In my case replacing line:
stop on stopping dbus
into:
stop on runlevel [06]
into the file /etc/init/network-manager.conf
fixes this problem.

Revision history for this message
Maarten Jacobs (maarten256) wrote :

I have the same issue - running Ubuntu 11.10 on a Dell Latitude D830.

The noted work-around above fixes the problem on my installation.

Revision history for this message
Maarten Jacobs (maarten256) wrote :

Retraction of my previous comment. I did implement the workaround and it worked once... Ever since I'm having the same issue again.

Revision history for this message
rogertux (rogerbassons) wrote :

I had the same issue but I fixed It after adding this line stop on runlevel [6] into the file /etc/init/network-manager.conf.
I've never had this issue since I added the line.

Revision history for this message
Lucazade (lucazade) wrote :

any news on this bug?
if necessary I could make some more tests.. it would be nice to a slick shutdown/restart in Precise!

Revision history for this message
Doug McMahon (mc3man) wrote :

Lucazade -
you may want to take a look at this report, probably the same issue, a different approach to 'working around' in lieu of any official fix which is not happening as of yet.

Bug 903825

Revision history for this message
Lucazade (lucazade) wrote :

thanks mc3man for the suggestion..
yes, i believe it is the same issue. I'll try that workaround to confirm the bug report.

Revision history for this message
Linus Seelinger (s-linus) wrote :

Changing /etc/init/network-manager.conf as mentioned here did not fully solve the problem for me.
Instead, it led to network-manager complaining about a missing messaging bus (DBus?) during shutdown (which was still too long ;) ).

The workaround mentioned in Bug 903825, however, seems to work perfectly.

Revision history for this message
Lucazade (lucazade) wrote :

Haven't tested yet the workaround 903825 but I can say the workaround I've posted in this bug report works on 3 of the 4 machines I use.

Is there a tag for Quality check to add to the bug report? something like the One Hundred Papercut?
An LTS release with this bug is really sad.

Revision history for this message
dino99 (9d9) wrote :

Not to spam this report, but for users having heavy troubles with network-manager, an other solution is:
- purging network-manager
- installing wicd

wicd works so smootly

Revision history for this message
Lucazade (lucazade) wrote :

Dino we are lucky that we have alternatives, and wicd is a good one, but we have to fix
this network manager issue also because it is a regression.

Revision history for this message
richud (richud.com) wrote :

This fixed it for me (I didn't alter the conf)
sudo mv /etc/rc6.d/S35networking /etc/rc6.d/S15networking
sudo mv /etc/rc0.d/S35networking /etc/rc0.d/S15networking

Taken from solution here;
https://bugs.launchpad.net/ubuntu/+source/netbase/+bug/903825

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
tags: added: precise-shutdown
Revision history for this message
Torsten Casselt (blu2lz) wrote :

#19 also did it for me. It is quite annoying to see Ubuntu shutdown almost as long as Windows, so please fix this issue! It is not a big deal changing the filenames, so please update as fast as possible.

Changed in network-manager (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
importance: Undecided → High
Revision history for this message
Nur Kholis M (kholis) wrote :

#19 works for me too.

Revision history for this message
z06gal (z06gal) wrote :

Add me to the #19 success list ;)

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/869635

tags: added: iso-testing
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

So, fixing up the package assignments. There's changes needed in three packages for this, and I'll push the updates shortly:

- NetworkManager should write pid files to /run/sendsigs.omit.d for processes it spawns (dhclient, dnsmasq). These processes will already be stopped by NetworkManager (and otherwise would get respawned during shutdown).

- ModemManager looks like it needs a small update to the upstart file to "stop on stopped network-manager", rather than "stop on stopping network-manager", to avoid it getting respawned via dbus if it's stopped too quickly before NetworkManager has a change to shutdown.

- wpasupplicant should write a pid file to /run/sendsigs.omit.d when spawned via dbus.

Changed in wpasupplicant (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Changed in modemmanager (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
dino99 (9d9) wrote :

On Precise i386, each time i shutdown the system in verbose mode, i can quickly see 2 lines complaining about "failed":

- check for active services (or so) ---> failed
- desactivating swap ----> failed

these lines are always in the 5 latest ones before real shutdown. Dont know if its important or not and related to this bug or not.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package modemmanager - 0.5.1.96+git201202081807.635fce1-0ubuntu2

---------------
modemmanager (0.5.1.96+git201202081807.635fce1-0ubuntu2) precise; urgency=low

  * debian/ubuntu/modemmanager.upstart: fix stop condition to make sure we stop
    only when NetworkManager is stopped as much as possible, to avoid being
    respawned by it via DBus. (LP: #869635, #919071)
 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 16 Feb 2012 10:43:54 -0500

Changed in modemmanager (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wpasupplicant - 0.7.3-6ubuntu1

---------------
wpasupplicant (0.7.3-6ubuntu1) precise; urgency=low

  * debian/patches/dbus-activation-cmdline.patch: have wpasupplicant create
    a pid file in /run/sendsigs.omit.d when activated by DBus. (LP: #869635)
 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 16 Feb 2012 16:21:29 -0500

Changed in wpasupplicant (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Oopsie, there's also a fix needed for dhclient to actually allow this particular file to be used; adding another task...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in isc-dhcp (Ubuntu):
status: New → Confirmed
affects: dhcp3 (Ubuntu) → isc-dhcp (Ubuntu)
Changed in isc-dhcp (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager - 0.9.2.0+git201202161854.8572ecf-0ubuntu1

---------------
network-manager (0.9.2.0+git201202161854.8572ecf-0ubuntu1) precise; urgency=low

  * upstream snapshot 2012-02-16 18:54:47 (GMT)
    + 8572ecfd7cc823097ff80de54ed6d7e17059c4fb
  * debian/patches/nl3-default-ip6-route.patch: refreshed.
  * debian/patches/manage-privacy-extensions.patch: allow NM to manage privacy
    extensions on a per-connection basis.
  * debian/libnm-util2.symbols: add/update symbols:
    + nm_setting_ip6_config_get_enable_ip6_privacy@Base
    + nm_setting_802_1x_ck_format_get_type@Base
    + nm_setting_802_1x_ck_scheme_get_type@Base
    + nm_setting_bond_add_option@Base
    + nm_setting_bond_get_num_options@Base
    + nm_setting_bond_get_option@Base
    + nm_setting_bond_get_option_by_name@Base
    + nm_setting_bond_remove_option@Base
    + nm_setting_compare_flags_get_type@Base
    + nm_setting_diff_result_get_type@Base
    + nm_setting_gsm_network_band_get_type@Base
    + nm_setting_gsm_network_type_get_type@Base
    + nm_setting_hash_flags_get_type@Base
    + nm_setting_secret_flags_get_type@Base
    + nm_utils_security_type_get_type@Base
    + nm_wep_key_type_get_type@Base
  * debian/libnm-glib4.symbols: add new symbols:
    + nm_client_permission_get_type@Base
    + nm_client_permission_result_get_type@Base
    + nm_secret_agent_get_secrets_flags_get_type@Base
    + nm_wimax_nsp_network_type_get_type@Base
  * debian/patches/add_sendsigs_omissions.patch: move NM pid files for dhclient
    and dnsmasq (and also dhcpcd and named if they were used) to the
    /run/sendsigs.omit.d directory and with a slightly different name. This
    will let us skip over those processes as shutdown since they will be killed
    by NetworkManager when its upstart job stops. (LP: #869635)
  * debian/rules: re-enable tests; run them inside dbus-test-runner.
  * debian/control: Build-Depends on dbus-test-runner for tests.
 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 16 Feb 2012 16:01:07 -0500

Changed in network-manager (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isc-dhcp - 4.1.1-P1-17ubuntu13

---------------
isc-dhcp (4.1.1-P1-17ubuntu13) precise; urgency=low

  * debian/apparmor-profile.dhclient: allow the new pid file for dhclient which
    NetworkManager will use. (LP: #869635)
 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 16 Feb 2012 17:01:19 -0500

Changed in isc-dhcp (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Benjamin Drung (bdrung) wrote :

Will these fixed backported to oneiric?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in isc-dhcp (Ubuntu Oneiric):
status: New → Confirmed
Changed in modemmanager (Ubuntu Oneiric):
status: New → Confirmed
Changed in network-manager (Ubuntu Oneiric):
status: New → Confirmed
Changed in wpasupplicant (Ubuntu Oneiric):
status: New → Confirmed
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Guess it could be SRU'd to oneiric.

Benjamin, can you confirm similar changes will solve the issues?

Revision history for this message
Ben Rolfe (ben-rolfe) wrote :

A duplicate of this bug (903825) includes a fix which worked perfectly for me in Oneiric:

The solution:

I renamed the links in /etc/rc0.d and rc6.d:

- S31umountnfs.sh to S05umountnfs.sh
- S35networking to S15networking

Revision history for this message
Lucazade (lucazade) wrote :

this bug was solved in Ubuntu but it still present in Kubuntu 12.04.
I had to apply my first workaround (present in original post) to get
a fast shutdown/restart.

Is it possible to fix this permanently also for kubuntu?

Revision history for this message
poacheR (tpapastylianou) wrote :

For anyone for whom the above solutions didn't work, passing "reboot=pci" as described in this page solved the problem for me http://serverfault.com/questions/126571/system-hangs-while-rebooting-on-debian
this appears to be related to acpi issues in the bios; the solutions above did not work for me.
(Disclaimer: this was on linux-mint (no, not the debian version), not ubuntu. However the bug was identical).

Revision history for this message
jetpeach (jetster) wrote :

I am on Kubuntu 12.04 and it also affects me still. Any fix for Kubuntu?

Revision history for this message
efonde (efonde) wrote :

actually this is not a bug. I have found the solution to this problem.

You just need to make sure that you have safely removes or eject all the removable drives (USB falsh disk, External Harddisk, etc) before shutting down. Because linux still reads it.

Mouse and external CD/DVD room doesn't have problems.

This way the message ( linux name : xxx tty1 modemmanager(805): caught signal (15)) won't show up at all.

So you don't need to edit conf, remove modemmanager or anything at all.

Revision history for this message
Lucazade (lucazade) wrote :

not a bug? so what is it? a feature??!?
you called it as well "problem" :)

btw the bug is present also without any usb device connected.

Revision history for this message
dino99 (9d9) wrote :

@Erie

im sorry to say that your comment is fully wrong here:

- ive no external device plugged on usb
- the mouse is plugged via an adaptor on ps2
- the problem of modemmanger delay only exist with network-manager & network-manager-gnome installed. If they are removed, and wicd installed instead, then the issue is gone.

That is on RR i386 logged as gnome-classic (without effects)

Revision history for this message
dino99 (9d9) wrote :

As you can see, that issue is still not fixed:
https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1024868

tags: added: oneiric
Revision history for this message
dino99 (9d9) wrote :

Whats the point to add a "oneiric" tag is a few days before its EOL ? https://wiki.ubuntu.com/Releases
and all the related packages are set "Fix Released".

Changed in wpasupplicant (Ubuntu Oneiric):
status: Confirmed → Incomplete
Changed in network-manager (Ubuntu Oneiric):
status: Confirmed → Incomplete
Changed in modemmanager (Ubuntu Oneiric):
status: Confirmed → Incomplete
Changed in isc-dhcp (Ubuntu Oneiric):
status: Confirmed → Incomplete
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

I added it because in a few days oneiric will reach EOL, so this bug would automatically be closed

Revision history for this message
Paul F (boxjunk) wrote :

See also LP: #1073433.

Revision history for this message
dino99 (9d9) wrote :

Oneiric is now EOL; so new bug might be reported if that trouble still exist.

Changed in isc-dhcp (Ubuntu Oneiric):
status: Incomplete → Invalid
Changed in modemmanager (Ubuntu Oneiric):
status: Incomplete → Invalid
Changed in network-manager (Ubuntu Oneiric):
status: Incomplete → Invalid
Changed in wpasupplicant (Ubuntu Oneiric):
status: Incomplete → Invalid
Revision history for this message
Lucazade (lucazade) wrote :

bug is still here.. but i'm not.. i'm on arch!
so tired to fix this bug in every ubuntu release by hand :(

Revision history for this message
Kaare Baastrup (kaare-baastrup) wrote :

The bug still exists in ubuntu 13.04

no longer affects: wpasupplicant (Ubuntu Oneiric)
no longer affects: network-manager (Ubuntu Oneiric)
no longer affects: modemmanager (Ubuntu Oneiric)
no longer affects: isc-dhcp (Ubuntu Oneiric)
Revision history for this message
Guyon (thetubbycat) wrote :

Compaq Evo D5PS
Linux Mint 15 Cinnamon

This happened only once, and it was when shutting down after installing from a USB, also having no internet connection. Just downloaded the iso yesterday using Unetbootin in Windows.

modem-manager (1500) caught signal 15 shutting down

Revision history for this message
Ali Najafi (alinajafi) wrote :

I still have the same issue even on 13.04 with modemmanager 0.6.0.0 and network-manager 0.9.8.0. None of the workarounds worked for me. It’s really annoying.

Revision history for this message
rolfinator (seb2) wrote :

I am resurrecting this thread, because I am living with this bug since 12.10 (and I am now on 13.10). None of the "workarounds" work *sigh*

Revision history for this message
msreekanth (sreekanth-manga) wrote :

I am facing this issue still on 14.10 . I have all the updates pushed by Ubuntu/Canonical. Earlier when I faced this issue, I removed the modem-manager and it worked like charm. This was like 2 weeks back. Now from last 3-4 days the issue is again. I am going to try one of these now:

1) adding the line:
stop on runlevel [6]
into the file /etc/init/network-manager.conf

- purging network-manager
- installing wicd
2)

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

Duplicates of this bug

Other bug subscribers

Related questions

Related blueprints

Remote bug watches

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