I have an ipaq running familiar linux and an IBM T30 laptop. I connect an empty USB cradle into the laptop. When I insert the ipaq into the cradle, or remove it, for the purpose of using a network connection, net.agent fails. Insertion: net.agent executes but exits because /var/lock/subsys/network does not exist. Removal: net.agent executes but the ACTION variable is set to "remove" which is not handled by the script. As a work-around, I patched net.agent like this: --- net.agent.bak 2004-03-24 02:14:45.000000000 -0600 +++ net.agent 2004-04-13 09:36:33.587781052 -0500 @@ -31,11 +31,6 @@ case $ACTION in add|register) - # Don't do anything if the network is stopped - if [ ! -f /var/lock/subsys/network ]; then - exit 0 - fi - case $INTERFACE in # interfaces that are registered after being "up" (?) ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*) @@ -55,7 +50,7 @@ mesg $1 $ACTION event not handled ;; -unregister) +unregister|remove) case $INTERFACE in # interfaces that are unregistered after being "down" (?) ppp*|ippp*|isdn*|plip*|lo*|irda*) I also cobbled together an ugly a /etc/init.d/net.usb0 script with a start() and stop() to modprobe usbnet and set up/tear down the interface configuration: #!/sbin/runscript # MRL 2004-03-24 hacked together for ipaq ptp link (based on net.lo) # MRL FIXME This is a really ugly hack! especially the MASQ stuff!! start() { ebegin "Bringing ${IFACE} up" modprobe usbnet /sbin/ifconfig ${IFACE} 10.0.0.1 netmask 255.255.255.255 pointopoint 10.0.0.2 /root/bin/fw-masq eend 0 } stop() { ebegin "Bringing ${IFACE} down" /sbin/ifconfig ${IFACE} down /root/bin/fw eend 0 } Reproducible: Always Steps to Reproduce: 1.Plug USB cradle into laptop without the ipaq 2.Insert ipaq into cradle 3.Remove ipaq from cradle Actual Results: In both cases, net.agent exited without attempting to run /etc/net.usb0 Expected Results: Insertion: execute "/etc/net.usb0 --quite start" Removal: execute "/etc/net.usb0 --quite stop" Gentoo Base System version 1.4.3.13 Portage 2.0.50-r5 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5) ================================================================= System uname: 2.6.5 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium3 -mcpu=pentium4 -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://mirrors.tds.net/gentoo http://mirror.tucdemonic.org/gentoo/ http://mirror.clarkson.edu/pub/distributions/gentoo/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X apm arts avi berkdb bonobo cdr crypt cups encode esd ethereal foomaticdb gdbm gif gnome gpm gps gtk gtk2 gtkhtml guile imlib java jpeg kde libg++ libwww mad mikmod motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex tiff truetype usb vim-with-x x86 xml2 xmms xv zlib"
What version of hotplug are you using? This should be all working in the latest version.
Also, if you are using udev, the latest version will allow you to rename network interfaces, and the proper /etc/init.d/net* file will be called when the device is brought up and down. So I really think this is solved...
Well, I was using sys-apps/hotplug-20040105 right up until the point I filed the bug report. You are quite correct. I just performed emerge sync which built sys-apps/hotplug-20040401 and sys-apps/hotplug-base-20040401. net.agent now works and I can see that it is fixed in pretty much the same way as my work-around. I cannot believe my timing with this! I do plan on using udev as soon as time permits. However, I don't understand how renaming interfaces would help in this case. Currently, net.agent tries execute net.usb0, which seems correct to me. What would be the "proper proper /etc/init.d/net* file"? Thanks.
Hmm... I guess Bugzilla doesn't wrap comment lines. Sorry about that.
Sorry, renaming interfaces would not help, but if you want to do that, it will work now :)