dispatcher script 01ifupdown never emits net-device-down

Bug #925411 reported by James Hunt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

NM runs /etc/NetworkManager/dispatcher.d/01ifupdown when a connection changes state.

If a connection is made, the dispatcher script runs:

    exec run-parts /etc/network/if-up.d

However, when a connection goes down, the dispatcher script runs:

    exec run-parts /etc/network/if-post-down.d

Crucially, it does not currently run:

    exec run-parts /etc/network/if-down.d

The problem here is that since it runs the post-down scripts, the net-device-down Upstart event is never emitted. This is emitted though by /etc/network/if-down.d/upstart.

Should the dispatcher run the if-down.d scripts rather than the if-post-down.d scripts? Or maybe it should run both?

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: network-manager 0.9.2.0+git201201101813.0b30200-0ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-12.21-generic-pae 3.2.2
Uname: Linux 3.2.0-12-generic-pae i686
NonfreeKernelModules: nvidia
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Thu Feb 2 11:06:29 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
IpRoute:
 default via 192.168.1.1 dev wlan0 proto static
 10.0.3.0/24 dev lxcbr0 proto kernel scope link src 10.0.3.1
 169.254.0.0/16 dev wlan0 scope link metric 1000
 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.2 metric 2
 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: network-manager
UpgradeStatus: Upgraded to precise on 2012-01-12 (20 days ago)
WifiSyslog:

modified.conffile..etc.NetworkManager.dispatcher.d.01ifupdown: [modified]
mtime.conffile..etc.NetworkManager.dispatcher.d.01ifupdown: 2011-11-23T08:49:12.888228
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH
 eth0 802-3-ethernet unavailable /org/freedesktop/NetworkManager/Devices/0
 wlan0 802-11-wireless connected /org/freedesktop/NetworkManager/Devices/1
nmcli-nm:
 RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
 running 0.9.3.0 connected enabled enabled enabled enabled disabled

Revision history for this message
James Hunt (jamesodhunt) wrote :
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

James,

This has been the case for a long while. Any reason why net-device-down should really get emitted by NetworkManager in these cases? I mean, practically, what uses this right now, just so we can have a sense of scale and purpose?

I'm not at all against having the /etc/network/if-down.d scripts, I'll just need to discuss this with upstream and the Debian NM maintainers and see if there's a reason why only if-post-down scripts were being run.

Changed in network-manager (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Ah, just looking at what's in if-down.d got me the exact answer for why this isn't the case right now: the dispatcher runs *after* the interface has been brought down.

How consequent is this with how net-device-down should be handled? Is it supposed to be emitted when the device is down or going down? And how are applications depending on this signal handling it, or expecting of the meaning of net-device-down?

FWIW, the same behavior applies to net-device-up: NetworkManager will "emit" it only once the device is truly up, not when it's being brought up.

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.