Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70226 - iptables/ip6tables can start after net
Summary: iptables/ip6tables can start after net
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 68198 84783 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-06 01:26 UTC by Ed Grimm
Modified: 2006-11-11 02:30 UTC (History)
10 users (show)

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


Attachments
Changes to /lib/rcscripts/awk/gendepends.awk (gendepends.diff,700 bytes, patch)
2004-11-23 17:30 UTC, Ed Grimm
Details | Diff
Patches to dependancy scanning awk scripts (depscan.sh.diff.d,3.35 KB, patch)
2004-12-01 01:39 UTC, Ed Grimm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Grimm 2004-11-06 01:26:52 UTC
net.eth0 does not provide 'net'.  Any attempts to make it provide net run up against some code which is apparently intended to kludge around errors during shutdown, but it happens before the dependancies are loaded.  As such, things that depend on net can start before the network is actually started, and things that must happen first might not.
Comment 1 SpanKY gentoo-dev 2004-11-07 22:05:32 UTC
you really need to provide information here on what the bug is and how you're experiencing it ...

what you've provided so far isnt really clear
Comment 2 Ed Grimm 2004-11-23 00:28:17 UTC
Depending upon what services I have starting in runlevel default, (but not in an apparently deterministic fashion), iptables will start either before or after net; it's supposed to start before net.

I have syslog configured to listen to a port so that it can receive syslog data from my other hosts; as such, it requires net.  It also may start before or after net.  If it starts before net, it will fail to start.

So far, I have not had other services which depend upon net attempt to start before net.  I suspect that's due to luck.

If I add 'provide net' to /etc/init.d/net.eth0, depscan.sh reports, "cannot add provide 'net', as a service with that same name exists!".

In /lib/rcscripts/awk/gendepends.awk, lines 408-411, net is added if it's not provided.  This appears to be to make shutdown quieter; if I comment this out, and 'provide net' in net.eth0, it works fine, except that shutdown complains bitterly.  Given this is in an END block, I'm not certain why this is happening before net is provided by net.eth0.
Comment 3 Ed Grimm 2004-11-23 00:44:19 UTC
I think I understand what's going on, after looking at this code a bit more - it doesn't catch the
new service before that check, because that service was added in this run level, and it doesn't
actually add the new services until right after that code.  I should be able to produce a patch
tomorrow evening.
Comment 4 Ed Grimm 2004-11-23 17:30:09 UTC
Created attachment 44611 [details, diff]
Changes to /lib/rcscripts/awk/gendepends.awk

Check for 'net', and add it if it doesn't exist, *AFTER* running through all
the service provides, rather than before.
Comment 5 Ed Grimm 2004-11-23 20:29:14 UTC
Comment on attachment 44611 [details, diff]
Changes to /lib/rcscripts/awk/gendepends.awk

This patch does not provide reliable results after more testing.

Also, more testing has shown that syslog-ng can at least occasionally start
successfully before net, so my primary motivation fixing this situation is
iptables and net.
Comment 6 Ed Grimm 2004-12-01 01:39:36 UTC
Created attachment 45042 [details, diff]
Patches to dependancy scanning awk scripts

'Before' seems to have difficulty.  I'm not sure what the issue is.  However, I
realized that fixing it wasn't worth my time - before does not provide the
functionality that I feel iptables needs; it has no effect on shutdown order,
as far as I can determine.

As such, the following patch adds the 'needsme' directive.  This indicates that
another service, much to its surprise, is dependent upon the service calling
needsme.  Thus, if iptables indicates that net.eth[0-9]* needs it, it will
start before any of them start, and they will shut down before it, unless the
iptables shutdown is accomplished by pause.  If iptables isn't installed, or
isn't started at that runlevel, there shouldn't be a dependency error.

This also eliminates a needless parsing of /sbin/functions.sh when converting
the dependencies from .ebuild to awk-comprehendible.
Comment 7 Henrik Brix Andersen 2005-01-10 09:04:56 UTC
*** Bug 68198 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2005-03-10 16:13:10 UTC
*** Bug 84783 has been marked as a duplicate of this bug. ***
Comment 9 gent_bz 2005-07-21 21:02:47 UTC
Is there any progress on this? I'm not particularly happy that iptables just
started after net.eth?.  This is a security concern and should be dealt with as
such.
Comment 10 Henrik Brix Andersen 2005-07-22 00:04:14 UTC
This is still a problem with sys-apps/baselayout-1.11.13, and I do agree it is a
security problem and should be dealt with as such.
Comment 11 Guillaume Castagnino 2005-08-17 10:54:51 UTC
As a temporary workaround, you could add iptables/ip6tables to boot instead of
default. So it will be started before network... Work for me, but it's only a
workaround, starting iptables at boot runlevel cannot be satisfactory.
Comment 12 Andy Wang 2006-08-02 19:23:46 UTC
This has been opened over 2 years now, and without any comment in almost a year.

Any progress on this at all?
Comment 13 Henrik Brix Andersen 2006-08-03 00:00:50 UTC
It is fixed in baselayout-1.12.x.
Comment 14 Roy Marples (RETIRED) gentoo-dev 2006-11-11 02:30:38 UTC
And it's really fixed in baselayout-1.13.0_alpha7