Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What's the purpose of the net.lo vs net.eth0 script??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
drvik
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2004
Posts: 121
Location: Adelaide, South Australia

PostPosted: Thu Dec 29, 2011 11:19 am    Post subject: What's the purpose of the net.lo vs net.eth0 script?? Reply with quote

Let me elaborate....

I'm trying to understand the relative functions of net.lo vs net.eth0 (as an example)...

My understanding is that net.lo provides the local loopback network (127.0.0.1) for other scripts such as mysql, which may only need a local loopback device rather than a "real" network connection... it provides "net" to the other scripts that have this dependency...

Net.eth0 also provides "net" to the other scripts by bringing up a "real" network connection...

Therefore, if I stop net.eth0, any scripts that depend on "net" should continue to run, even though they no longer have access to a "real" network connection...

If I stop net.eth0, why does /etc/init.d/mythbackend also stop when I am connecting to a local mysql server and may not have any remote frontends?? This means if for some reason my network service is stopped, then mythbackend will no longer be able to record...

NUT scripts including upsdrv, upsd, and upsmon (I'm using a USB UPS), also rely on "net" even if you are monitoring a local USB UPS... so if my net.eth0 is stopped I no longer have the ability to shutdown the system automatically if there's a power failure and my UPS is running low...

If I delete net.eth0, why does the ntpd script start but the ntp-client script does not? Why doesn't mysql start (this is probably why mythbackend doesn't start)??

Why does mysql depend on netmount and nfsmount and therefore on a "real" net connection?? isn't it enough to just depend on "net"?

Why does nxserver only depend on "net" and therefore will start up when only net.lo is available, therefore being pointless (no real network access)??

"netmount" depends on "net" but "net.eth0" is shutdown before "netmount"


Am I just showing a really poor understanding of how these dependencies are supposed to work or is there some kind of problem here??? Shouldn't essentially everything that depends on "net" start, as long as I have successfully started net.lo??? And therefore, shouldn't everything that depends on net, also remain running even if I stop the net.eth0 service as long as net.lo continues to run??? Are these just limitations of the current init system design? Script errors? Is this what "SystemD" is trying to address??


Apologies for my rambling and lack of understanding...

drvik
Back to top
View user's profile Send private message
jormartr
Apprentice
Apprentice


Joined: 02 Jan 2008
Posts: 174

PostPosted: Thu Dec 29, 2011 12:17 pm    Post subject: Reply with quote

net.lo does not provide network, but net.eth0 does.

For example, I have some tap's and bridges in my network, and I define them with:
Code:

...
rc_provide_tap0="!net"
...
rc_provide_br0="!net"
...


that way, scripts that depend on "network" know that these interfaces does not provide networking to them. Only net.eth0 provides external networking on my computer.

This way, I guess that the loopback interface is internally defined with not providing network.

I hope I may explained it somewhat.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46322
Location: 56N 3W

PostPosted: Thu Dec 29, 2011 4:14 pm    Post subject: Reply with quote

drvik,

The network service is only considered to be available when all network interfaces are up, by defualt.
If you don't want this behaviour, you need to edit /etc/rc.conf
Its well commented.

Laptop users often have other wlan0 and eth0 defined but want either on its own to provide networking.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1162

PostPosted: Wed Dec 23, 2015 5:21 pm    Post subject: Reply with quote

Can someone please confirm if net.lo should be enabled by default? On two of my boxen it isn't:
Code:
# rc-update -s -v | grep net.lo
               net.lo |         

_________________
Regards,
Mick
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46322
Location: 56N 3W

PostPosted: Wed Dec 23, 2015 6:25 pm    Post subject: Reply with quote

MickKi,

Maybe.

It will be started by other things that depend on it even if its not started explictily.
Here, its
Code:
net.lo | boot

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum