# Why /etc/init.d/dhcpcd does "provides net"

## bzaborow

Hi all,

I've just wasted few hours figuring why dhcpcd starts in my system when I intentionally disabled starting at boot time any of the net interfaces.

Finally I found that for some reason dhcpcd service claims it "provides net". Since it was the only not disabled service providing net at my box it was started in "needed" runlevel (as a dependency for netmount, which was at default runlevel by a mistake  :Wink: ). The problem was that during boot it every time brought up all interfaces and hung the boot process for ~20 seconds waiting for responses before it went background.

Nevermind, now I wonder why dhcpcd is supposed to provide net? In my case it not only does not provide any network connection, but also is useless, since I want to setup the connection manually, for example using modem with wvdial (it discovers IP address somehow itself). And other ifaces, like net.wlan0 handled by wpa_supplicant or net.eth0 run their own instance of dhcp when I start them manually. Maybe the dhcpcd service should be just "before net"?

PS. I'm new at the forum, so I'm sorry if I opened the thread in wrong place or something.

----------

## NeddySeagoon

bzaborow,

I noticed you were new, welcome to Gentoo.

dhcpcd is not installed unless you ask for it.  It should only be in the default runlevel it you will use it on all of your interfaces.

It will be called as required if you only need it on some interfaces.

A modem and wvdial will set up a ppp link. The host at the other end of the link will tell your PC how to set up the interface ppp0.

You may want to edit /etc/rc.conf ... the comments will help

----------

## bzaborow

 *NeddySeagoon wrote:*   

> bzaborow,
> 
> I noticed you were new, welcome to Gentoo.
> 
> dhcpcd is not installed unless you ask for it.  It should only be in the default runlevel it you will use it on all of your interfaces.
> ...

 

Im not new to Gentoo, just never posted to gentoo forums;)

The dhcpcd is not in default runlevel, it never was on this machine. It was started as a dependency by netmount, as I stated before. In particular, I've already played with /etc/rc.conf to disable autostarting of net.eth0 and net.wlan0.

The dhcpcd autostarting was not really my question, just a background and the problem is now solved. Maybe I didn't emphasize my question enough: I would like to understand how openrc works in gentoo better and this behaviour (dhcpcd providing net) seems strange to me. Maybe I don't understand the meaning of "net" or something - thats why I ask.

----------

## szatox

"net" is not defined, as it might refer to usable connection (NetworkManager's way), configured network interface (netifRC way) or even local loopback (very old openrc way)

Dhcpcd used to be only a module used for autoconfiguration, it seems it was turned into a service itself when openrc split into openrc and netifrc, so dhcpcd is self-sufficient now. I'm not dev, it' my guess about reasons.

So, basicaly if want to use dhcpcd the old way, only as a module rather than net service (leaving this job to netifrc), `echo rc_provide="!net" >> /etc/conf.d/dhcpcd`  or  `echo rc_provide="!*" >> /etc/conf.d/dhcpcd`   should restore old behaviour - netifrc will bring interfaces up and call dhcpcd to assign address

----------

