modules is a critical service in /sbin/rc by default, once the network interface module was loaded, hotplug will start the net.etho. when rc do dependency check, it will stop net.eth0 as it was started and therefore bring down eth0. in preup, link detect will always be "no-link" as the eth0 is marked down during dependency check. Reproducible: Always Steps to Reproduce: 1. Enable preup and linkdetect funtion in /etc/conf.d/net, 2. Modify preup() function for linkdetect to preup_linkdetect $1 || return 1 Without step 2, even link detect fail, net.eth0 will try to get an IP address through DHCP even though linkdetect fail. Actual Results: eth0 will be brought down after dependency check, and won't get initialized even the network is connected and link test is oK. Expected Results: eth0 initialized successfully with an IP address from DHCP sys-apps/baselayout-1.10.3 I remove modules from critical service as a work around, which works. Portage 2.0.50-r9 (default-x86-1.4, gcc-3.3.4, glibc-2.3.4.20040808-r0, 2.6.8) ================================================================= System uname: 2.6.8 i686 Intel(R) Pentium(R) M processor 1300MHz Gentoo Base System version 1.5.2 Autoconf: sys-devel/autoconf-2.59-r4 Automake: sys-devel/automake-1.8.5-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -g -O3 -pipe" 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/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium3 -g -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache nostrip sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X alsa apache2 apm arts avi berkdb bonobo cdr cjk crypt cups doc dvd encode esd evo foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imap imlib java jpeg ldap libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls ofx oggvorbis opengl opie oss pam pdflib perl png postgres python quicktime readline ruby sdl slang spell sse ssl svga swig tcpd truetype x86 xml2 xmms xv zlib"
i dont understand why you're using link detect when you've just shown it doesnt work for you link detect is provided as an optional feature for users to toy with, that's about all
There is an annoying waiting time for DHCP if not connecting to network without link detect, that's what I am trying to do and I thought the preup is for. Maybe there is some other better way to go? Anyway, no matter whether link detect is working or no, the up and down of eth0 caused by hotplug + dependency check is still some would-be-nice-to-fix minor glitch.
yes, set the timeout for dhcp to like 5 seconds or something low hotplug is one huge mess and i'm pretty sure there's another bug (or 5) open about it
dont use link detect if it doesnt work for you