Many net-based apps just assume that if the net doesn't exist, then that app can't run based on their /etc/init.d/* setups. Some examples are apache2 and postfix. Obviously, they can't run to their fullest potential, but they still work great when not connected to a network. I use this on my laptop consistently so that I can test web sites without being connected to the net and queueing email that will be sent when I reconnect to the network. Reproducible: Always Steps to Reproduce: 1. emerge apache2/postfix/etc. 2. disconnect from the network 3. reboot Actual Results: Programs don't run at startup because they can't connect to the net Expected Results: Started without network connectivitiy. Apache should still accept connections on localhost and postfix should queue up messages until connectivitiy returns. By changing need to use in the respective /etc/init.d/* files, this result happens.
could you please write a list of apps which do you think are affected
Sure, I did "find . -type f | xargs grep -l "/sbin/runscript" | xargs grep need | grep net" in /usr/portage to get a list of all the files that have this need set. I don't know if all of them need it or not, and really need the ebuild maintainer to certify. Some that I have questions about are: * usermin * webmin (if you're administering a local machine) * lirc (why does IR stuff need a network?) * lcdproc (why does LCD stuff need a network?) * distcc (for testing you may only want to connect to localhost) * xindice * mysql * postgresql * oftpd, jftpgw, vsftpd, pure-ftpd, proftpd, tftp-hpa (can serve FTP to self for testing) * dancer-ircd, unrealircd, irc-server, ultimate (can serve IRC intentionally only to self) * openldap? (not as sure, but could do ldap testing on single box) * boa, apache, orion, cherokee, monkeyd, mini_httpd (test WWW servers offline) * resin?, resin-ee? * tomcat? * xinetd, netkit-base * apcupsd (remote shutdown is a use--not a need) * daemontools * win4lin? * courier, xmail, courier-imap, postfix, sendmail (want to send mail with MTA when not connected to net) * amavisd-new, clamav (check virii whenever) * ptrtd? * fakeidentd, oidentd, linux-identd (respond whenever connected) * possibly lots of other net-misc deamons that you would want on your laptop for tunnelling, etc. * omniORB (can't CORBA be local?) * hylafax (only receive/send faxes when connected to net) * zope? (seems to me development could be done on an unconnected box) * lprng (if printer is directly connected to box) * setiathome (must connect eventually, but not necessary at startup) * mythtv? (do I need to connect my PVR to a network?) * possibly the net-analyzer tools if you bring a trace home to look at more carefully Obviously, I didn't go through each file to determine if it works or not, but I think this is a good list of applications that might need some changes.
how about bug 29225 ?
Didn't see that bug in my search, but it is the same issue. This bug is valuable in that it enumerates the extent of the issue and lists many other packages other than apache and mysql. Some should be fixed by lo providing net and others probably really do need to change from a "need net" to "use net".
Created attachment 30559 [details, diff] Multi-file patch for modifying init.d/apache[2] files Being a laptop user I strongly agree. There are many applications that I use where this change can apply.
I think there's a misunderstanding here of what "need net" really implies. Virtually all of the applications in the list are not just network aware apps, they are native network apps that can't run without a working IP stack. (The only one that I would argue really doesn't "need net" daemon-tools) That means that you have to have everything from the physical layer, the datalink layer, the network layer, etc. However, for laptops and other disconnected hosts all you really need to have up and running is localhost on 127.0.0.1. So, that would imply that once that was up, your "need net" requirements should be filled, right? If my inference is correct, the only thing that needs to happen is that the documentation be updated to reflect what "need net" is.
The misunderstanding is a significant part of this problem. From your description, you assume that need net implies net.lo, when in fact it implies net.eth0 or some other external interface. If net.lo provide'd net, then all of these programs would work on a laptop while disconnected. They don't because the net dependancy isn't met by the loopback device. As I understand the situation, we can't just change net.lo to provide net because we really would prefer for these apps to wait to come up after the NIC is ready to communicate with the outside world. That's where use net comes in: we try to initialize our apps after we try to connect to the outside world, but if we are disconnected, we are still able to proceed without failing.
see RC_NET_STRICT_CHECKING in /etc/conf.d/rc to easily control on a per-machine basis if having net.lo is sufficent to satisfy the net dependancy.
I don't know at configuration time if net.lo is sufficient. If I'm connected to the network, it isn't, but if I'm disconnected it is. As stated in my last response, if net.lo provides net, then all those wonderful network apps can try to start before net.eth0 is ready for them. I want them to start after net.eth0 tries to initialize and to work with whatever network exists after that time.
forking this bug because 1 huge bug just doesnt work ... file sep bugs for each package in the future * usermin * webmin (if you're administering a local machine) Bug 66464 * lirc (why does IR stuff need a network?) this doesnt * lcdproc (why does LCD stuff need a network?) doesnt seem to have a maintainer; fixed it myself * distcc (for testing you may only want to connect to localhost) * xindice * mysql * postgresql * oftpd, jftpgw, vsftpd, pure-ftpd, proftpd, tftp-hpa (can serve FTP to self for testing) * dancer-ircd, unrealircd, irc-server, ultimate (can serve IRC intentionally only to self) * openldap? (not as sure, but could do ldap testing on single box) * boa, apache, orion, cherokee, monkeyd, mini_httpd (test WWW servers offline) * resin?, resin-ee? * tomcat? * xinetd, netkit-base * apcupsd (remote shutdown is a use--not a need) * daemontools * win4lin? * courier, xmail, courier-imap, postfix, sendmail (want to send mail with MTA when not connected to net) * amavisd-new, clamav (check virii whenever) * ptrtd? * fakeidentd, oidentd, linux-identd (respond whenever connected) * possibly lots of other net-misc deamons that you would want on your laptop for tunnelling, etc. * omniORB (can't CORBA be local?) * hylafax (only receive/send faxes when connected to net) * zope? (seems to me development could be done on an unconnected box) * lprng (if printer is directly connected to box) * setiathome (must connect eventually, but not necessary at startup) * mythtv? (do I need to connect my PVR to a network?) * possibly the net-analyzer tools if you bring a trace home to look at more carefully
bleh, hit commit by accident before i finished * distcc (for testing you may only want to connect to localhost) file a bug for lisa * xindice Bug 66465 * mysql Bug 66466 * postgresql already been fixed * oftpd, jftpgw, vsftpd, pure-ftpd, proftpd, tftp-hpa (can serve FTP to self for testing) fixed oftpd/jftpgw myself running a tftp w/out a network connection is dumb file bugs for vsftpd/pure-ftpd/proftpd * dancer-ircd, unrealircd, irc-server, ultimate (can serve IRC intentionally only to self) Bug 66467 * openldap? (not as sure, but could do ldap testing on single box) * boa, apache, orion, cherokee, monkeyd, mini_httpd (test WWW servers offline) * resin?, resin-ee? * tomcat? file bugs * xinetd, netkit-base fixed these * apcupsd (remote shutdown is a use--not a need) * daemontools * win4lin? * courier, xmail, courier-imap, postfix, sendmail (want to send mail with MTA when not connected to net) * amavisd-new, clamav (check virii whenever) * ptrtd? file bugs * fakeidentd, oidentd, linux-identd (respond whenever connected) fixed fakeidentd, file bugs for the others * possibly lots of other net-misc deamons that you would want on your laptop for tunnelling, etc. * omniORB (can't CORBA be local?) * hylafax (only receive/send faxes when connected to net) * zope? (seems to me development could be done on an unconnected box) * lprng (if printer is directly connected to box) file bugs * setiathome (must connect eventually, but not necessary at startup) fixed myself * mythtv? (do I need to connect my PVR to a network?) * possibly the net-analyzer tools if you bring a trace home to look at more carefully file bugs