Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5431 - virtual/net shoudl be more flexible
Summary: virtual/net shoudl be more flexible
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-22 17:58 UTC by Olivier Crete (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
remove requirement that net.* be part of the current/boot runlevel (flexible-net.diff,420 bytes, patch)
2002-07-22 18:00 UTC, Olivier Crete (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Crete (RETIRED) gentoo-dev 2002-07-22 17:58:50 UTC
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
Comment 1 Olivier Crete (RETIRED) gentoo-dev 2002-07-22 18:00:30 UTC
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...
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-22 23:39:51 UTC
"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".
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-23 00:11:45 UTC
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.
Comment 4 Olivier Crete (RETIRED) gentoo-dev 2002-07-23 00:26:56 UTC
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...
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-23 13:58:25 UTC
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?

Comment 6 Olivier Crete (RETIRED) gentoo-dev 2002-07-23 14:38:13 UTC
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)
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-08 15:55:20 UTC
---------------------------
  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.
Comment 8 Olivier Crete (RETIRED) gentoo-dev 2002-12-08 16:45:53 UTC
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 
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-09 14:15:00 UTC
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.
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-25 14:40:49 UTC
The problem of the original submitter are fixed.