Summary: | net.lo should provide net | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Radek Podgorny <radek> |
Component: | [OLD] baselayout | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | adam, ladanyi, mholzer |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 13143, 33161, 66472 |
Description
Radek Podgorny
2003-09-20 15:54:30 UTC
(copy of post to bug 13143 -> don't know who's gonna solve this) Come on guys. Let net.lo provide "net" or remove the "need net" dependancies from the startup scripts which don't need it (like apache and stuff) but DO SOMETHING, please... Until then, I can't do the PHP development on my notebook (when it's unplugged from the network while booting -> it cannot get DHCP answer -> net.eth0 startup fails -> apache2 refuses to start) and that's bad since PHP development is what I get money for... :-) Of course I have my scripts modified but every upstream (Gentoo) update forces me to do that research again and again... :-( Thanks... Radek Add /etc/init.d/net.eth9 (or whatever, note its _not_ eth0): -- #!/sbin/runscript start() { ebegin "Starting fake network" eend 0 } -- Add above to boot runlevel, and you should be set. You might even call above 'net.fake', but I am not sure if it needs the traling digit currently or not ... I already use net.adsl which means you don't have to append the number... Anyway, it's just a dirty hack. I was begging for some system-level solution... :-( Radek *** Bug 48879 has been marked as a duplicate of this bug. *** this should be configurable in /etc/conf.d/rc now # Set to "yes" if the default behaviour of at least one net.* # service starting beside net.lo is NOT enouth to consider # the 'net' dependency up and running. RC_NET_STRICT_CHECKING="no" Sorry to say, but this does NOT solve the bug. See the "beside net.lo" in the comment? This bug is about convincing the gentoo devs the "lo" interface is nothing special and is technically not different from for exapmple eth0. You can run apache and stuff when using ONLY loopback but the current setup does not consider the "net.lo" service to be a part of the "net" grou which apache depends on... :-( Thanks... Radek umm, actually it does, read the comment set RC_NET_STRICT_CHECKING=no and you need only have net.lo running to have 'net' considered up i use that on my laptop and it works fine OK, I have it set to "no" for some time now and AFAIK the only way to solve this problem was to have a net.fake interface... ...anyway, I will try it and let you know... ...thanks. Radek Sorry, not working. When I try to power on my laptop in a network-less :-) enviroment, the DHCP request (of the net.eth0) simply times out and sshd, xinetd, netmount and others just refuse to launch only telling the service they needed in their dependancy failed to load. BUT, there's something weird, distcc loads fine (has "net" as the only dep) but sshd (which also has only the "net" as dep) does not... Ask me further, please. I'd like to have this figured out... Radek ok, i was wrong about RC_NET_STRICT_CHECKING ... it's purpose is to require all net.* scripts to work properly or at least one (not counting net.lo) we'll look into alternative options ;) Added a 'lo' option to RC_NET_STRICT_CHECKING ----- Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/ChangeLog,v retrieving revision 1.458 diff -u -r1.458 ChangeLog --- ChangeLog 31 Oct 2004 11:27:38 -0000 1.458 +++ ChangeLog 31 Oct 2004 12:23:08 -0000 @@ -12,6 +12,8 @@ Move things around in /sbin/functions.sh to have all functions above. + Add the 'lo' option to RC_NET_STRICT_CHECKING to resolve bug #29225. + 28 Oct 2004; Martin Schlemmer <azarah@gentoo.org>: Only add files not managed by udev to device tarball, bug #57110. Index: etc/conf.d/rc =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/rc,v retrieving revision 1.18 diff -u -r1.18 rc --- etc/conf.d/rc 28 Oct 2004 23:49:55 -0000 1.18 +++ etc/conf.d/rc 31 Oct 2004 12:23:08 -0000 @@ -15,8 +15,17 @@ RC_PARALLEL_STARTUP="no" -# Set to "yes" if you require a net.* service running (other than -# just net.lo) to satisfy the generic 'net' dependency +# RC_NET_STRICT_CHECKING allows some flexability with the 'net' service. +# The following values are allowed: +# no - This basically means that at least one net.* service besides net.lo +# must be up. This can be used by notebook users that have a wifi and +# a static nic, and only wants one up at any given time to have the +# 'net' service seen as up. +# lo - This is the same as the 'no' option, but net.lo is also counted. +# This should be useful to people that do not care about any specific +# interface being up at boot. +# yes - For this ALL network interfaces MUST be up for the 'net' service to +# be considered up. RC_NET_STRICT_CHECKING="no" Index: sbin/rc-services.sh =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/sbin/rc-services.sh,v retrieving revision 1.19 diff -u -r1.19 rc-services.sh --- sbin/rc-services.sh 19 Sep 2004 05:39:28 -0000 1.19 +++ sbin/rc-services.sh 31 Oct 2004 12:23:08 -0000 @@ -556,6 +556,39 @@ return 0 } +# bool is_net_up() +# +# Return true if service 'net' is considered up, else false. +# +# Notes for RC_NET_STRICT_CHECKING values: +# lo Interface 'lo' is counted and if only it is up, net is up. +# no Interface 'lo' is not counted, and net is down even with it up, +# so there have to be at least one other interface up. +# yes All interfaces must be up. +is_net_up() { + local netcount=0 + + case "${RC_NET_STRICT_CHECKING}" in + lo) + netcount="$(ls -1 "${svcdir}"/started/net.* 2> /dev/null | \ + egrep -c "\/net\..*$")" + ;; + *) + netcount="$(ls -1 "${svcdir}"/started/net.* 2> /dev/null | \ + grep -v 'net\.lo' | egrep -c "\/net\..*$")" + ;; + esac + + # Only worry about net.* services if this is the last one running, + # or if RC_NET_STRICT_CHECKING is set ... + if [ "${netcount}" -lt 1 -o "${RC_NET_STRICT_CHECKING}" = "yes" ] + then + return 1 + fi + + return 0 +} + # void schedule_service_startup(service) # # Schedule 'service' for startup, in parallel if possible. Index: sbin/runscript.sh =================================================================== RCS file: /var/cvsroot/gentoo-src/rc-scripts/sbin/runscript.sh,v retrieving revision 1.39 diff -u -r1.39 runscript.sh --- sbin/runscript.sh 28 Oct 2004 14:01:27 -0000 1.39 +++ sbin/runscript.sh 31 Oct 2004 12:23:08 -0000 @@ -131,12 +131,9 @@ if in_runlevel "${myservice}" "${BOOTLEVEL}" || \ in_runlevel "${myservice}" "${mylevel}" then - local netcount="$(ls -1 "${svcdir}"/started/net.* 2> /dev/null | \ - grep -v 'net\.lo' | egrep -c "\/net\.[[:alnum:]]+$")" - # Only worry about net.* services if this is the last one running, # or if RC_NET_STRICT_CHECKING is set ... - if [ "${netcount}" -lt 1 -o "${RC_NET_STRICT_CHECKING}" = "yes" ] + if is_net_up then mydeps="net" fi @@ -276,13 +273,10 @@ # A 'need' dependency is critical for startup if [ "$?" -ne 0 ] && ineed -t "${myservice}" "${x}" >/dev/null then - 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 + # up and running already, or if RC_NET_STRICT_CHECKING # is set .... - if [ "${netcount}" -lt 1 -o "${RC_NET_STRICT_CHECKING}" = "yes" ] + if is_net_up then startfail="yes" fi |