GNOME Bugzilla – Bug 605579
if-down.d should be dispatched before interface goes down (phase is "pre-down")
Last modified: 2010-01-20 22:39:05 UTC
nm_device_state_changed() in src/nm-device.c waits until the interface goes down to call nm_utils_call_dispatcher("down",...). As a result, scripts in /etc/network/if-down.d do not have access to the network when they run. (Try putting a script in the if-down.d directory that runs "logger 'NM DEBUG' `ifconfig $IFACE`" and you will see in the syslog that the interface is down.) This is incorrect, because it does not conform to the behavior of ifupdown, and because many packages install scripts in if-down.d that expect the network to be available. (For instance, I might want to install a script that sends my log-off time to a remote server, ships out logs of what I've been doing, etc.) I tried changing nm-device.c to put the "down" dispatcher call just after caching the activation request, but that did not help - the interface is still down when the scripts run. if-post-down.d is supposed to be for running the "post-down" phase. Tons of other people and packages have depended on the consistent behavior of standardized pre-up, post-up, pre-down and post-down PHASE values. It is not fair to the larger community for RedHat engineers to change this to disrupt the behavior of other flavors of Linux. (if-pre-up.d and if-post-down.d is bug number 600167 at https://bugzilla.gnome.org/show_bug.cgi?id=600167)
*** This bug has been marked as a duplicate of bug 387832 ***