/etc/network/if-down.d scripts not run when network device is removed
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.
Gotcha. NetworkManagerD ispatcher 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# NetworkManagerD ispatcher --no-daemon p/NetworkManage r/Devices/ eth0 (eth0) is now going up.
** Message: <info> Device /org/freedeskto
** Message: <info> Device /org/freedeskto p/NetworkManage r/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.