network manager does not run files in /etc/network/if-pre-up.d

Bug #304004 reported by Damien Robert
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: network-manager

On ubuntu intrepid:
/etc/NetworkManager/dispatcher.d/01ifupdown reads the file in the directory
/etc/network/if-$2.d. The problem is that this script is only called with the down or up command, never the pre-up command, so the files in /etc/network/if-preup.d are not read prior to establishing the connection.
( i added echo "$@" >> /tmp/blouh at the beginning of the script, and after some plugging/unplugging of the network cable or using the gnome-applet to disable/enable the network, i get:
cat /tmp/blouh
eth0 down
eth0 up
eth0 down
eth0 up
There is no preup/postdown calls, which is a problem since there are scripts in the corresponding directories.)

Revision history for this message
MarcH (marc-h38) wrote :

I definitely confirm this. What is extremely confusing is the following source code in "dispatcher.d/01ifupdown":

case "$2" in
    up) .....
    down) ...
    pre-up) .... !?
    post-down) .... !?
esac

Has the author of this script really used it?

This is quite a regression considering that hooks in /etc/dhcp3/ are not run either (another problem).

Revision history for this message
MarcH (marc-h38) wrote :

Here is a scary hack to run-parts /etc/network/if-down.d. I will deny having written this patch, but it works4me.

Revision history for this message
Petr Sodomka (pesmail2003) wrote :

There is probably duplicate of this bug here: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/336736

They say it was changed in upstream. But we have lots of packages which depends on this:

apt-file search etc/network/if-pre-up.d
bridge-utils: /etc/network/if-pre-up.d/bridge
ethtool: /etc/network/if-pre-up.d/ethtool
hostap-utils: /etc/network/if-pre-up.d/hostap-utils
hostapd: /etc/network/if-pre-up.d/hostapd
ifenslave-2.6: /etc/network/if-pre-up.d/ifenslave
ifupdown-extra: /etc/network/if-pre-up.d/00check-network-cable
ifupdown-scripts-zg2: /etc/network/if-pre-up.d/00README.linkdir
linux-wlan-ng: /etc/network/if-pre-up.d/linux-wlan-ng-pre-up
uml-utilities: /etc/network/if-pre-up.d/uml-utilities
vde2: /etc/network/if-pre-up.d/vde2
vlan: /etc/network/if-pre-up.d/vlan
whereami: /etc/network/if-pre-up.d/whereami
wireless-tools: /etc/network/if-pre-up.d/wireless-tools
wpasupplicant: /etc/network/if-pre-up.d/wpasupplicant

As suggested in similar bug in Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518368

I think if-pre-up and if-post-down functionality should be brought back!

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.