Bug 354341 - RFE: NetworkManagerDispatcher needs something like preup and predown events
RFE: NetworkManagerDispatcher needs something like preup and predown events
Status: ASSIGNED
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Lubomir Rintel
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-26 11:57 EDT by Thorsten Leemhuis
Modified: 2015-08-18 10:56 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Run dispatch scripts before taking down interfaces (864 bytes, patch)
2008-09-17 17:24 EDT, Orion Poplawski
no flags Details | Diff
Drop call in dispose (568 bytes, patch)
2008-09-17 17:56 EDT, Orion Poplawski
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 387832 None None None Never

  None (edit)
Description Thorsten Leemhuis 2007-10-26 11:57:25 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).
Comment 1 Orion Poplawski 2008-03-19 16:40:12 EDT
Agreed that this is definitely (and desperately?) needed.  In my cases it is to
shutdown NIS, autofs, and nfs mounts.
Comment 2 Jon Stanley 2008-04-23 16:29:03 EDT
Adding FutureFeature keyword to RFE's.
Comment 3 Orion Poplawski 2008-09-17 17:24:41 EDT
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.
Comment 4 Orion Poplawski 2008-09-17 17:56:33 EDT
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.
Comment 5 Dan Williams 2009-03-03 16:04:17 EST
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.
Comment 6 Marko Myllynen 2010-03-23 06:43:05 EDT
Since pre-up and pre-down events share some infrastructure let's make this RFE about both of them.
Comment 7 Max Kessler 2011-08-18 14:14:31 EDT
Preup would be good.  For some reason /etc/sysconfig/network-scripts/ifup-wireless isn't being run when I plug in my wireless card.
Comment 8 Dominique Brazziel 2015-07-02 15:45:09 EDT
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.
Comment 9 Fedora Admin XMLRPC Client 2015-08-18 10:56:15 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Note You need to log in before you can comment on or make changes to this bug.