From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fumitoshi UKAI Date: Mon, 07 Jan 2002 17:07:09 +0000 Subject: ifdown on unregister for debian system Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi, I'm linux-hotplug debian package maintainer. On debian system, ifup/ifdown keep status of interface status (up/down) in ifstate database, so ifdown is necessary when network interface unregistered. Unless ifdown is called, next registering net device will fail because it was already up in ifstate database. --- hotplug-0.0.20010919.orig/etc/hotplug/net.agent +++ hotplug-0.0.20010919/etc/hotplug/net.agent @@ -9,6 +9,7 @@ # # HISTORY: # +# 30-Sep-2001 ifdown on unregister for debian system # 25-Feb-2001 Special case ppp and similar (redhat) # 23-Jan-2001 Log invocation of "ifup" if debugging # 04-Jan-2001 Initial version of "new" hotplug agent. @@ -45,13 +46,27 @@ debug_mesg invoke ifup $INTERFACE exec /sbin/ifup $INTERFACE else - mesg "how do I bring interfaces up on this distro?" + # mesg "how do I bring interfaces up on this distro?" + mesg "E: /sbin/ifup not found. You need to install ifupdown package" fi ;; esac mesg $1 $ACTION event not handled ;; +unregister) + # Assume that we want to run ifdown no matter what, + # because it's not going to remove the data from the + # ifstate database otherwise. + if [ -x /sbin/ifdown ]; then + debug_mesg invoke ifdown $INTERFACE + exec /sbin/ifdown $INTERFACE + else + # mesg "how do I bring interfaces up on this distro?" + mesg "E: /sbin/ifdown not found. You need to install ifupdown package" + fi + mesg $1 $ACTION event not handled + ;; *) debug_mesg NET $ACTION event not supported exit 1 ;; Regards, Fumitoshi UKAI _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel