Bug 354341 - RFE: NetworkManagerDispatcher needs something like preup and predown events
Summary: RFE: NetworkManagerDispatcher needs something like preup and predown events
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-26 15:57 UTC by Thorsten Leemhuis
Modified: 2022-01-22 00:08 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 387832 0 None None None Never

Description Thorsten Leemhuis 2007-10-26 15:57:25 UTC
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 20:40:12 UTC
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 20:29:03 UTC
Adding FutureFeature keyword to RFE's.

Comment 3 Orion Poplawski 2008-09-17 21:24:41 UTC
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 21:56:33 UTC
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 21:04:17 UTC
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 10:43:05 UTC
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 18:14:31 UTC
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 19:45:09 UTC
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 14:56:15 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 genjosholiday.com 2022-01-22 00:08:48 UTC Comment hidden (spam)

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