Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 439092 (need-net)

Summary: [tracker] services misusing "need net"
Product: Gentoo Hosted Projects Reporter: William Hubbs <williamh>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: CONFIRMED ---    
Severity: normal CC: alexanderyt, andreis.vinogradovs, asm64, bugzilla, jdavid.ibp, luke, michael.stahn.42, nikoli, sam, xmw
Priority: Normal Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/OpenRC/openrc/blob/master/service-script-guide.md#be-wary-of-need-net-dependencies
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 447996, 514858, 228973, 266386, 439100, 439564, 439568, 439572, 439652, 439654, 439656, 439658, 439660, 439662, 439664, 447630, 482092, 484658, 490446, 514860, 514872, 520294, 525412, 530828, 542162    
Bug Blocks:    
Attachments: sshd init script

Description William Hubbs gentoo-dev 2012-10-20 18:48:35 UTC
This is to track the service scripts which are using "need net"
unnecessarily.

Most of the time services do not really "need net", and this should be
removed.

The problem with having it is that bringing down one interface
automatically brings down the services that have "need net" in their
dependencies.
Comment 1 William Hubbs gentoo-dev 2012-10-20 19:12:25 UTC
To test your service to see if it really needs net, do the following:

- bring down *all* of your network interfaces, including loopback.
- drop the "need net" line from your init script.
- bring up your service in its default configuration.
- If it comes up successfully, try cycling network interfaces and using
  your service with different interfaces up and down. If it works, you
  are done; commit your init script without the "need net" dependency.
  - If it doesn't work, you will need to add documentation to your
	conf.d/service file explaining to users how to  tie your service to
	which ever interface they are using it on with an rc_need line.

Feel free to contact me with questions.
Comment 2 William Hubbs gentoo-dev 2012-10-31 16:52:27 UTC
Flameeyes wrote the following blog post concerning this issue:

http://blog.flameeyes.eu/2012/10/may-i-have-a-network-connection-please
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-11-23 16:14:33 UTC
*** Bug 444260 has been marked as a duplicate of this bug. ***
Comment 4 A Collector 2012-11-25 06:52:20 UTC
Please see https://bugs.gentoo.org/show_bug.cgi?id=444652 and let me know if it's related. Thanks.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-12-14 16:26:23 UTC
*** Bug 447156 has been marked as a duplicate of this bug. ***
Comment 6 mike 2012-12-15 18:49:49 UTC
/etc/init.d/netmount is triggering NetworkManager (+dbus +....) to start without any "need net". Looks like a hidden "need net" in some dependency.
Comment 7 mike 2013-03-24 19:53:37 UTC
Created attachment 343152 [details]
sshd init script

sshd does not need "need net"
Comment 8 Alex Xu (Hello71) 2015-06-11 16:23:45 UTC
*** Bug 268688 has been marked as a duplicate of this bug. ***