Bug 2409

Summary: ifdown-pre hook
Product: Sisyphus Reporter: imz <vanyaz>
Component: net-scriptsAssignee: Denis Ovsienko <pilot>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: ldv
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2003-03-23 14:44:09 MSK
A hook for a script that is run before an interface is brought down can be useful (in /sbin/ifdown).

ifdown-pre is symmetric to ifup-post script (which is supported).

This hook can be used to perform some kind of de-registration actions in the net, or to stop some processes that have been monitoring the corresponding link (started in ifup-post).
---

---
I implemented it like this:

--- /sbin/ifdown.orig   2001-03-04 17:19:07 +0300
+++ /sbin/ifdown        2002-05-19 16:32:21 +0400
@@ -78,6 +78,8 @@
        \&quot;$DHCPCD\&quot; -k \&quot;$DEVICE\&quot;
 fi
 
+/etc/sysconfig/network-scripts/ifdown-pre \&quot;$DEVICE\&quot; || exit 1
+
 ifconfig \&quot;$DEVICE\&quot; down
 [ \&quot;$retcode\&quot; = \&quot;0\&quot; ] &amp;&amp; retcode=$?
 
I found also another implementation by RH:

<a href="http://rhlinux.redhat.com/cgi-bin/cvsweb.cgi/initscripts/sysconfig/network-scripts/ifdown.diff?r1=1.10&amp;r2=1.10.2.1">http://rhlinux.redhat.com/cgi-bin/cvsweb.cgi/initscripts/sysconfig/network-scripts/ifdown.diff?r1=1.10&amp;r2=1.10.2.1</a>

initscripts-5.49-ipl52mdk
Comment 1 Denis Ovsienko 2004-03-17 22:26:21 MSK
взял
Comment 2 Denis Ovsienko 2004-03-22 13:49:06 MSK
Резонно, скорее всего сделаю.
Comment 3 Denis Ovsienko 2004-05-22 16:54:51 MSD
Пошло в 0.4.8