In runscript.sh, there is a section of code titled: "Only worry about a net.* sevice if we do not have one ip and running already." This section reports a failure when the first interface fails to come up, but the second succeeds. It should not. Reproducible: Always Steps to Reproduce: 1. Install two interfaces (eth0, eth1) 2. Unplug eth0 3. /etc/init.d/net.eth* stop 4. /etc/init.d/sshd start Actual Results: sshd will try to bring up eth0 (and fail), then try to bring up eth1 (and succeed). Then "sshd start" fails. Expected Results: sshd should have been succesful The following patch fixes the problem --- /sbin/runscript.sh~ 2003-07-11 17:02:39.000000000 -0400 +++ /sbin/runscript.sh 2003-07-11 17:04:04.000000000 -0400 @@ -252,22 +252,24 @@ then /etc/init.d/"${myserv}" start - # A 'need' dependancy is critical for startup - if [ "$?" -ne "0" -a -L "${svcdir}/need/${x}/${myservice}" ] - then - local netcount="$(ls -1 ${svcdir}/started/net.* 2> /dev/null | \ + fi + done + # A 'need' dependancy is critical for startup + if [ "$?" -ne "0" -a -L "${svcdir}/need/${x}/${myservice}" ] + then + echo Testing: + ls -1 ${svcdir}/started/net.* + local netcount="$(ls -1 ${svcdir}/started/net.* 2> /dev/null | \ grep -v 'net\.lo' | egrep -c "\/net\.[[:alnum:]]+$")" - + # Only worry about a net.* service if we do not have # one up and running already, or if # RC_NET_SCTRICT_CHECKING is set .... - if [ "${netcount}" -lt "1" -o "${RC_NET_STRICT_CHECKING}" = "yes" ] - then - startfail="yes" - fi - fi - fi - done + if [ "${netcount}" -lt "1" -o "${RC_NET_STRICT_CHECKING}" = "yes" ] + then + startfail="yes" + fi + fi else if [ ! -L "${svcdir}/started/${x}" ] then
Please add the patch as attachment.
Created attachment 14564 [details, diff] First tentative patch With this patch, an attempt is made at bringing all the net.* interfaces up. The dependency success if at least one interface is up after the attemps.
Created attachment 14565 [details, diff] Second tentative patch With this patch, an attempt to bring an interface up will only be made if there isn't an interface up already. This is better than the previous patch, I think.
I think the approach of "try to bring them all up, but only fail if not enough could be started" is the better one, as this is more what is expected.
I have a laptop with both an Ethernet port and a wireless port. Depending on where I am in the building, I sometimes have access to one or the other, sometimes to both, and sometimes I have access to neither. I filled this bug when I realized I could not start sshd with "/etc/init.d/sshd start" if I was in a wireless-enabled room, but I did not have the Ethernet wire plugged in. With the first patch, runscript.sh stalls for 20 seconds trying to get an IP dhcp address over an non-existing wire, even if I have a perfectly good wireless connection going. It is rather annoying. The second patch realizes the wireless connection is A-OK, and start sshd right away. What's really happening is, we do not have a clear semantic which says what "need net" should mean. Somebody should make a decision and document it. Above was my particular story. I suspect in other cases, you really do want to have all interfaces up. And in some other cases maybe you care about have to most interfaces available. Maybe we could have difference need dependency for each. My case would be: "need net.some", the second: "need net.most", and third case: "need.all". Of course, the general solution would be to do what ebuild packages do: have a first-order-logic language of boolean expressions to express dependencies between services.
What is the status on this bug? 3/4 of a year later I'm having an identical situation as the original reporter. I looked at the proposed patches, but it appears that runscript.sh has changed since then in the pertinent sections (maybe to address this problem?) so the patches are no longer appropriate. Is something perhaps rebroken? I don't remember seeing this problem a few months ago.
I am facing this problem too. I am additionally astounded, that the file /etc/conf.d/rc is containing a variable to control the behaviour, named RC_NET_STRICT_CHECKING. With this variable set to "no", network should be considered up, if at least one network interface besides net.lo was successfully started. Unfortuanaly, this looks to be disregarded completly, as every net dependend process still tries to bring up my WLAN network, even if there is a connection on the fixed line.
make sure baselayout-1.11.12 doesnt handle this properly ... re-open if it doesnt play around with RC_NET_STRICT_CHECKING in /etc/conf.d/rc