Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 288588 - net-misc/dhcpcd-5.1.1 /etc/init.d/dhcpcd needs use network with openrc 0.5.1
Summary: net-misc/dhcpcd-5.1.1 /etc/init.d/dhcpcd needs use network with openrc 0.5.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-11 16:44 UTC by Vasco Steinmetz
Modified: 2009-10-26 03:04 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vasco Steinmetz 2009-10-11 16:44:00 UTC
After upgrading to openrc 0.5.1 and its new network configuration style I had to add dhcpcd's init script to the the default runlevel.
Unfortunately /etc/init.d/dhcpcd gets called before /etc/init.d/network and though it receives a default route from the dhcp server and sets it, the route doesn't show up.

Fix: Add "use network" in /etc/init.d/dhcpcd.

Reproducible: Always

Steps to Reproduce:
1. Emerge openrc 0.5.1 and switch to new-style configuration scheme
2. Add dhcpcd to default runlevel
3. Reboot system

Actual Results:  
An ip lease and a default route is received and set by dhcpcd. The route doesn't show up after logging in.

Expected Results:  
The route should be set correctly.
Comment 1 Simon Siemonsma 2009-10-11 20:07:57 UTC
When installing openrc I got this:
LOG: preinst
...
Auto-adding 'network' service to your boot runlevel
...l
Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone
init.d scripts.  If you use such a thing, make sure you have the
required init.d scripts added to your boot runlevel.

So it automatically installed network in the boot runlevel.
This is run before the default runlevel.

I wonder why this didn't happen in your case.
Maybe you can add network to the boot runlevel yourself
Comment 2 Vasco Steinmetz 2009-10-11 20:50:24 UTC
I still have to add dhcpcd to boot or default runlevels.
Problem is that network may be then started *after* dhcpcd.
Comment 3 Simon Siemonsma 2009-10-12 15:58:41 UTC
(In reply to comment #2)
> I still have to add dhcpcd to boot or default runlevels.
> Problem is that network may be then started *after* dhcpcd.
> 

As I understood it boot runlevel is done before default runlevel.
So when network is in boot runlevel and dhcpcd in default runlevel this shouldn't be a problem.

Simon
Comment 4 William Hubbs gentoo-dev 2009-10-21 18:00:51 UTC
First, make sure to add network to the boot runlevel and remove the old
net.* scripts from all runlevels.

The network script only configures static ip addresses, so do not
attempt to set an address for an interface you are planning to use dhcp
on in /etc/conf.d/network.

Now add dhcpcd to the default runlevel.

Once you have done this, reboot your system and report back if the
address and default route are set up correctly.

Comment 5 William Hubbs gentoo-dev 2009-10-21 18:08:03 UTC
Also, you do not need the "use network" line that you propose.
Comment 6 Vasco Steinmetz 2009-10-21 20:42:25 UTC
The problem still remains if both scripts are in the same runlevel.
Under that circumstance it is not assured that network gets started before dhcpcd.

And as mentioned earlier, dhcpcd fails to set the default route if the network script (without any static IPs configured whatsoever) hasn't run earlier. Actually my conf.d/network is the default one.

Having network in boot and dhcpcd in different runlevels is a possibility but not a requirement.

I discussed the problem with Roy Marples (dev of dhcpcd and openrc) before filing this bug and he said openrc's network script has to be run before dhcpcd.
Whatever it does while interface discovery or to the routing tables is unbeknownst to me.

Problem still exists with 0.5.2-r1.
Temporary workaround: have /etc/init.d/network run in boot and /etc/init.d/dhcpcd in default.
Comment 7 Vasco Steinmetz 2009-10-21 20:43:47 UTC
> Problem still exists with 0.5.2-r1.

openrc-0.5.2-r1 and dhcpcd-5.1.2 to be precise.
Comment 8 William Hubbs gentoo-dev 2009-10-26 03:04:04 UTC
This is fixed in dhcpcd-5.1.3-r1.