Red Hat Bugzilla – Bug 354341
RFE: NetworkManagerDispatcher needs something like preup and predown events
Last modified: 2015-08-18 10:56:15 EDT
Description of problem:
I mount CIFS share with mount.cifs in a script called by
NetworkManagerDispatcher after a interface has been brought up. But I can't
properly umount the CIFS share with NetworkManagerDispatcher -- when changing
Networks or shutting the system down (see also Bug 218237 which is related) it
gets only called after the interface is down causing umount to hang for a long
time (round about 2 minutes iirc) because it tries to reach the server and fails.
If NetworkManagerDispatcher would have a predown event in addition to "up" and
"down" I would be able to umount the interface probably on system shutdown or
when changing networks (Ethernet -> WLAN or vice versa).
Agreed that this is definitely (and desperately?) needed. In my cases it is to
shutdown NIS, autofs, and nfs mounts.
Adding FutureFeature keyword to RFE's.
Created attachment 317009 [details]
Run dispatch scripts before taking down interfaces
How about this? Not sure if the call is needed in dispose.
I could also imagine using "predown" instead of "down", but I'm not sure if any dispatch scripts would really be doing different things if called before or after the interface is actually down. It would also result in the scripts being called twice - once before and once after, but that should be harmless.
Created attachment 317013 [details]
Drop call in dispose
Okay, need to drop the call in dispose at least because req is undefined there. Not sure if a call should be there though.
In any case, what does the system do if the connection just drpos? Any system needs to handle unexpected disconnections cleanly even if there was a pre-down event. If it can handle unexpected disconnections without hanging your box for 2 minutes, then this wouldn't be as large of an issue. Have any fixes gone into CIFS to handle unexpected disconnections in a better way? Adding a 'pre-down' wouldn't really fix the core issue here; it's only advisory and would only get called on orderly shutdown. It wouldn't get called in cases like a) network cable unplugged, b) wifi AP disconnects you, c) wifi driver fails to maintain connection, d) you go out of range, e) DHCP fails to renew the lease because a switch somewhere died, etc. Many of these cases are common, and I'd expect whatever needed a 'pre-down' event to handle these correctly without a pre-down event. Furthermore, NetworkManager cannot block on executing pre-down scripts, thus script execution would be time-bounded, and if the script did not complete within, say, 3 seconds, it would be terminated anyway.
Since pre-up and pre-down events share some infrastructure let's make this RFE about both of them.
Preup would be good. For some reason /etc/sysconfig/network-scripts/ifup-wireless isn't being run when I plug in my wireless card.
Wow, this is old. I am running into this bug now, as when the system is put to
sleep nm-dispatcher is not running scripts in '/etc/NetworkManager/dispatcher.d/pre-down.d'. The problem is that when NetworkManager receives the sleep signal from UPower (via dbus I assume), it
immediately starts deactivating the device to sleep and the dispatcher only executes scripts with action 'down'. If NM is restarted, the pre-down.d script
is executed. Perhaps it is a case of NM considering a restart an 'orderly' shutdown event and going to sleep not orderly?
In my use case I am trying to take down the browser , ssh, and any other networking apps.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.