Bug 14175 - hotplug-20020401-r1 net unplug get wrong
Bug#: 14175 Product:  Gentoo Linux Version: 1.4_rc2 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: azarah@gentoo.org Reported By: suzuki-youji@my.email.ne.jp
Component: Library
URL: 
Summary: hotplug-20020401-r1 net unplug get wrong
Keywords:  
Status Whiteboard: 
Opened: 2003-01-19 07:17 0000
Description:   Opened: 2003-01-19 07:17 0000
I tried usbdnet. I made /etc/init.d/net.usb0 copying from net.eth0, and
modifing
stop() function only to do 'ebegin' and 'eend 0'. I modified /etc/conf.d/net to
ifconfig for usb0.
Hot-plugging is OK. But, after hot-unplugging, /mnt/.init.d/started/net.usb0
still exists, then next hot-plugging failed.(ifconfig isn't executed).

This is because, in net.usb0's stop() function "eend 0" returns "1" , then
stop() returns "1" , so /sbin/runscript.sh remake /mnt/.initd/started/net.usb0.
The reason why "eend 0" returns "1" is that QUIET_STDOUT is not 'yes' so echo
to
stdout is failed.

I modified /etc/hotplug/net.agent to call /etc/init.d/net.$INTERFACE with
"--quiet" option, then this problem was fixed.

*** ./net.agent.ORIG    Sun Jan 19 18:20:20 2003
--- ./net.agent Sun Jan 19 19:42:53 2003
***************
*** 43,49 ****
            # handle gentoo init script style
            if [ -x /etc/init.d/net.$INTERFACE ]; then
                debug_mesg invoke /etc/init.d/net.$INTERFACE start
!               exec /etc/init.d/net.$INTERFACE start
            # RedHat and similar
            elif [ -x /sbin/ifup ]; then
                debug_mesg invoke ifup $INTERFACE
--- 43,49 ----
            # handle gentoo init script style
            if [ -x /etc/init.d/net.$INTERFACE ]; then
                debug_mesg invoke /etc/init.d/net.$INTERFACE start
!               exec /etc/init.d/net.$INTERFACE --quiet start
            # RedHat and similar
            elif [ -x /sbin/ifup ]; then
                debug_mesg invoke ifup $INTERFACE
***************
*** 67,73 ****
            # handle gentoo init script style
            if [ -x /etc/init.d/net.$INTERFACE ]; then
                debug_mesg invoke /etc/init.d/net.$INTERFACE stop
!               exec /etc/init.d/net.$INTERFACE stop
            # RedHat and similar
            elif [ -x /sbin/ifdown ]; then
                debug_mesg invoke ifdown $INTERFACE
--- 67,73 ----
            # handle gentoo init script style
            if [ -x /etc/init.d/net.$INTERFACE ]; then
                debug_mesg invoke /etc/init.d/net.$INTERFACE stop
!               exec /etc/init.d/net.$INTERFACE --quiet stop
            # RedHat and similar
            elif [ -x /sbin/ifdown ]; then
                debug_mesg invoke ifdown $INTERFACE

------- Comment #1 From Martin Schlemmer (RETIRED) 2003-01-21 09:12:50 0000 -------
Wout, this fine to add ?  Look ok to me.

------- Comment #2 From Wout Mertens (RETIRED) 2003-01-21 09:53:40 0000 -------
Looks fine to me as well. Can't test, though...

------- Comment #3 From Martin Schlemmer (RETIRED) 2003-01-21 11:33:52 0000 -------
Oki, you taking, or who is semi official for hotplug ?

------- Comment #4 From Wout Mertens (RETIRED) 2003-03-19 08:31:50 0000 -------
I'll see what I can do. 

------- Comment #5 From Martin Schlemmer (RETIRED) 2003-03-20 10:17:26 0000 -------
And?

------- Comment #6 From Wout Mertens (RETIRED) 2003-03-26 12:25:16 0000 -------
Changed initscripts invocation in 20020826-r2, including the --quiet. Works
fine, and complains less 
on the whole.