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

* Re: ifdown on unregister for debian system
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Bill Nottingham @ 2002-01-07 17:36 UTC (permalink / raw)
  To: linux-hotplug

Fumitoshi UKAI (ukai@debian.or.jp) said: 
> 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.

This patch:
a) refers to a debian-specific package
b) refers to debian-specific ifdown behavior

Is there any chance it could be cleaned up, or kept as a debian-specifc
diff?

Bill

_______________________________________________
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

* Re: ifdown on unregister for debian system
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Fumitoshi UKAI @ 2002-01-07 17:41 UTC (permalink / raw)
  To: linux-hotplug

At Mon, 7 Jan 2002 12:36:05 -0500,
Bill Nottingham wrote:
> 
> Fumitoshi UKAI (ukai@debian.or.jp) said: 
> > 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.
> 
> This patch:
> a) refers to a debian-specific package
> b) refers to debian-specific ifdown behavior
> 
> Is there any chance it could be cleaned up, or kept as a debian-specifc
> diff?

debian's ifup/ifdown uses /etc/network/ifstate for status database.
How about checking the /etc/network/ifstate file existance to run ifdown?

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

* Re: ifdown on unregister for debian system
  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
  4 siblings, 0 replies; 6+ messages in thread
From: Bill Nottingham @ 2002-01-07 17:44 UTC (permalink / raw)
  To: linux-hotplug

Fumitoshi UKAI (ukai@debian.or.jp) said: 
> > This patch:
> > a) refers to a debian-specific package
> > b) refers to debian-specific ifdown behavior
> > 
> > Is there any chance it could be cleaned up, or kept as a debian-specifc
> > diff?
> 
> debian's ifup/ifdown uses /etc/network/ifstate for status database.
> How about checking the /etc/network/ifstate file existance to run ifdown?

That could work, I suppose.

The situation on Red Hat is that ifdown is used to bring down the
network interface; if you've gotten the unregister event from the
driver, that means the network interface is already down, so running
ifdown doesn't gain you much.

Bill

_______________________________________________
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

* Re: ifdown on unregister for debian system
  2002-01-07 17:07 ifdown on unregister for debian system Fumitoshi UKAI
                   ` (2 preceding siblings ...)
  2002-01-07 17:44 ` Bill Nottingham
@ 2002-01-07 17:59 ` David Brownell
  2002-01-07 18:05 ` David Brownell
  4 siblings, 0 replies; 6+ messages in thread
From: David Brownell @ 2002-01-07 17:59 UTC (permalink / raw)
  To: linux-hotplug

That sounds about right.

My understanding -- please correct if appropriate! -- is that
for the moment, distros have "agreed to disagree" about
details of network administration, at this level, 

So I believe that logic along the lines of "if [ distro is X] ..."
is unfortunately appropriate in these cases.  Maybe in
a few years we'll have more convergence, which hotplug
can be a part of ... :)

- Dave


----- Original Message ----- 
From: "Fumitoshi UKAI" <ukai@debian.or.jp>
To: "Bill Nottingham" <notting@redhat.com>
Cc: <linux-hotplug-devel@lists.sourceforge.net>
Sent: Monday, January 07, 2002 9:41 AM
Subject: Re: ifdown on unregister for debian system


> At Mon, 7 Jan 2002 12:36:05 -0500,
> Bill Nottingham wrote:
> > 
> > Fumitoshi UKAI (ukai@debian.or.jp) said: 
> > > 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.
> > 
> > This patch:
> > a) refers to a debian-specific package
> > b) refers to debian-specific ifdown behavior
> > 
> > Is there any chance it could be cleaned up, or kept as a debian-specifc
> > diff?
> 
> debian's ifup/ifdown uses /etc/network/ifstate for status database.
> How about checking the /etc/network/ifstate file existance to run ifdown?
> 
> 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

* Re: ifdown on unregister for debian system
  2002-01-07 17:07 ifdown on unregister for debian system Fumitoshi UKAI
                   ` (3 preceding siblings ...)
  2002-01-07 17:59 ` David Brownell
@ 2002-01-07 18:05 ` David Brownell
  4 siblings, 0 replies; 6+ messages in thread
From: David Brownell @ 2002-01-07 18:05 UTC (permalink / raw)
  To: linux-hotplug

> The situation on Red Hat is that ifdown is used to bring down the
> network interface;

... or hardware level actions like usb disconnect and cardbus eject.

>     if you've gotten the unregister event from the
> driver, that means the network interface is already down, so running
> ifdown doesn't gain you much.

Actually for the 2.5 series I'd like to see someone look at
some of these issue some more ... there's inconsistency
in how the various network interfaces behave, as shown
by all the name-based special cases.  History ... :)

- Dave



_______________________________________________
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).