/etc/network/if-down.d scripts not run when network device is removed

Bug #214638 reported by Alan Jenkins
2
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: network-manager

Ubuntu-version: gutsy

I'm running Ubuntu on an Asus EEEpc, and connecting to my home router using a USB cable (driver cdc-ether). NetworkManager automatically detects and configures the connection when I plug it in, yay.

I can tell when if-up / if-down scripts get run because I'm using the polipo caching web proxy. When the device is inserted, if-up.d/01polipo gets run, polipo goes into online mode, so I can surf the Web through my proxy. If I click on NetworkManager and "Switch to Offline mode", the connection is brought down, ip-down.d/01polipo is run and polipo switches to offline mode. I can then browse cached pages offline. So far so good.

But if I physically remove the USB cable, the if-down.d scripts don't get run. Polipo thinks it's still connected, attempts to fetch requested pages from the internet, and fails - so I can't browse cached pages because I just get error messages.

Can NetworkManager please be fixed so it runs if-down.d scripts when the network device is removed? This is exactly what happens if you configure a hotpluggable device for use with ifupdown instead of using NetworkManager.

Revision history for this message
Alan Jenkins (aj504) wrote :

Gotcha. NetworkManagerDispatcher tries to get the interface name (e.g. eth0) by querying the dbus device object, which no longer exists.

Hmm. I thought of a couple of solutions but they're not that elegant. I wonder if there's a general solution to the problem of object removal events in dbus.

Example output from a plug-unplug cycle showing this problem:

root@alan-eeepc:/etc/network# NetworkManagerDispatcher --no-daemon
** Message: <info> Device /org/freedesktop/NetworkManager/Devices/eth0 (eth0) is now going up.

** Message: <info> Device /org/freedesktop/NetworkManager/Devices/eth0 (eth0) is now up.

** (process:5839): WARNING **: <WARN> nmd_get_device_name(): org.freedesktop.NetworkManager.DeviceNotFound raised: The requested network device does not exist.

** (process:5839): WARNING **: <WARN> nmd_get_device_name(): org.freedesktop.NetworkManager.DeviceNotFound raised: The requested network device does not exist.

Revision history for this message
Alan Jenkins (aj504) wrote :

I've had a fix accepted into NM 0.6.x. (It was already fixed in 0.7, but Hardy will still use 0.6.x).

<http://mail.gnome.org/archives/networkmanager-list/2008-April/msg00112.html>

Revision history for this message
Alexander Sack (asac) wrote :

this is fixed now in intrepid. even nfs unmount works ;)

Changed in network-manager:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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