I have a laptop. I can be connected to the net in three different ways: ethernet w/ dhcp, ethernet with pppoe and dial-up ppp... So I dont want to add any net.* service representing a real interface to my boot scripts. I dont see any reason for the requirement that the service be part of the boot or current runlevel. Having it started should be enough Switching runlevels is also not appriopriate, because I must first try to start pppoe and if this fails try dhcp.. This bug is related to bug 2706.. but I think its different
Created attachment 2473 [details, diff] remove requirement that net.* be part of the current/boot runlevel it still tried to start any non-started network service even with this patch applied.. this is bad.. because starting net.eth0 (dhcp) kills the pppoe connection...
"net" is required for some services to start, as they need to bind to a interface other than lo, and they wont bind to a "eth" interface without being restarted if that interface was not up. The whole point of adding the preffered net.* to boot or default is so that the initscript will know what network interface to bring up if a service requires "net". Thus I cannot see how you want to hack it out. If you dont want a net.* in startup, then just dont add it with any service thet depends on "net".
Oh, and it will only try to start any net.* services if they are in the boot or current runlevel (like you said), thus the only fix that I do think will be appropriate, is not to stop any net.* services on runlevel change if they were not added specifically to the previous runlevel.
Hmm couldnt just check if there is a non-lo interface up and then define the net service as started... Hmm, actually it seems to work correctly if there is no net.* in the current runlevel...
See, the theory behind it, is that if some services needs to bind to a specific interface (bind to name one), then you add whatever interface to boot or your default runlevel, and when bind starts, it will depend on "net", which in turn will start the required interfaces (all net.* added to boot or current). Thus if you dont want this to happen, just dont add any to boot or default (except maybe net.lo), and the rc-scripts should not error out. You will then just have to remember to start the required services after you have initialized your network. Alternatively, you could create a very basic default runlevel, and then create three additional runlevels that are basically the same, with all services that depends on an external network interface, and just add to each the network script you use to get it up. For instance the following runlevels: dhcp, pppoe, ppp The only problem I can forsee, is what to name the network services. Guess net.eth1, net.eth2, net.eth3 'should' not confuse things too much. Then after boot, you just do: # rc dhcp to start the dhcp interface and needed services if you want to use dhcp. to reset to fresh booted state, just run: # rc default again. Comments?
Hmm, the problem with that approach is that I want it to be automated.. so that it first tries pppoe and if it fails then tries dhcp, that's why the runlevel approach doesnt work.... I have finally take a different approach I removed all net.* services from my runlevels.. modified most net requirements to net.lo and I now use the "ifd" deamon which runs a script each time there is a physical connection (using link-beat detection)... my link change script is at http://tester.dyndns.org:81/link-change if you are interested... (ifd and stuff come from debian's laptop-net) Btw, most net.* requiring services (I think sendmail in particular) are perfectly happy with only net.lo running, I dont see why they need net.... (could be need net.lo, use net)
--------------------------- 26 Nov 2002; Martin Schlemmer <azarah@gentoo.org>: Change default 'net' dependency behaviour to be more suited for notebook users. Basically if at least one net.* service beside net.lo start successfully, the 'net' dependency is considered up. Server admin can set RC_NET_STRICT_CHECKING="yes" in /etc/conf.d/rc to change this back to the old default. This is the start to address bug #2706. --------------------------- This should be in baselayout 1.8.5.5 when out.
Another comment: portmap, sendmail, ssh and xinetd dont seem to really require a real network device to be up. They work even if I change their dependency to net.lo... So you should probably have a "net" and a "net.real" virtual device
Yes, but not having a real (external) net device may be a mistake by the user, so its better to fail if nothing gets started at all, as it should work for most things. Like the ChangeLog entry said, 'net' is considered up if at least one net.* service besides net.lo is started, and I think that should cover most bases, and also serve as a check for 'forgot to add net.eth0 to default/boot' type problems. Anyhow, 1.8.5.5 should be out later, so please test first, then give feedback.
The problem of the original submitter are fixed.