linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ifdown on unregister for debian system
@ 2002-01-07 17:07 Fumitoshi UKAI
  2002-01-07 17:36 ` Bill Nottingham
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Fumitoshi UKAI @ 2002-01-07 17:07 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-01-07 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-07 17:07 ifdown on unregister for debian system Fumitoshi UKAI
2002-01-07 17:36 ` Bill Nottingham
2002-01-07 17:41 ` Fumitoshi UKAI
2002-01-07 17:44 ` Bill Nottingham
2002-01-07 17:59 ` David Brownell
2002-01-07 18:05 ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).