# [solved] Cannot disable dhcpd

## GOS

Hello,

strange thing. I removed dhcpd from all runlevels but dhcpd starts and overwrites my static configuration in "/etc/conf.d/net"

```
# rc-update -v show | grep dhcpcd

               dhcpcd |     
```

Any ideas why dhcpd is starting? I use OpenRC.

Best regards

GOSLast edited by GOS on Sat Mar 15, 2014 9:13 pm; edited 1 time in total

----------

## GOS

Strange thing; I made a world update --> Now it is working   :Shocked: 

----------

## khayyam

GOS ... its probably as something 'need[s] net' (which dhcpcd provides) ... if you (or anyone searching the forums) run into this issue again you can add the following to /etc/rc.conf ...

```
rc_dhcpcd_provide="!net"
```

best ... khay

----------

## steveL

 *khayyam wrote:*   

> GOS ... its probably as something 'need[s] net' (which dhcpcd provides) ... if you (or anyone searching the forums) run into this issue again you can add the following to /etc/rc.conf ...
> 
> ```
> rc_dhcpcd_provide="!net"
> ```
> ...

 

Hey khay,

That's curious, though I guess logical. I thought eth0 etc provided net though, so if your network card isn't working, what good is it to start dhcpcd?

I can understand needing your dhcpcd up before you can do other network things, it just seems a bit odd. If eth0 is also going to provide it, then surely that means it's going to be considered fulfilled before dhcpcd is up? Or does it merge them into one thing, where all are required for the provides to be fulfilled?

It seems to me that it'd be better to have another layer on top of net, called network, to allow plumbing etc to be setup after network connections, and before servers requiring IP addresses. (Or change net to phy.)

Sorry if I'm missing something obvious, or that's changed recently.

Regards,

igli.

----------

## khayyam

 *steveL wrote:*   

>  *khayyam wrote:*   
> 
> ```
> rc_dhcpcd_provide="!net"
> ```
> ...

 

hey steve/igli ... I'm having to clear out some cobwebs on this one as my memory is a little vague as to when and why this change came about. Anyhow, I believe it was contiguous with the openrc/netifrc split.

As '/etc/init.d/net.ethX' may not exist, if anything 'need[s] net' then dhcpcd is the default provider (as it will automatically detect and manage interfaces). net.eth0 can't 'provide net' as its only there if and when the user makes the symlink, whereas the dhcpcd service is there given the user has installed the package.

 *steveL wrote:*   

> I can understand needing your dhcpcd up before you can do other network things, it just seems a bit odd. If eth0 is also going to provide it, then surely that means it's going to be considered fulfilled before dhcpcd is up? Or does it merge them into one thing, where all are required for the provides to be fulfilled?

 

Well, there is "eth0" (or enfoo1xyz or what-have-you) the interface, and then the service (with its provisions and dependencies in terms of openrc's initialisation). The "service" is covered by anything  providing "net" which just needs to be met if something "need[s] net" ... so, its just a fallback to have dhcpcd (if its installed) be the default provider. Remember, net.ethX calls dhcp (one or other client) it doesn't start the service, the reverse it true for providing 'net', a service has to provide this, and as net.ethX is user created this may not exist ... hence dhcpcd being the default. With the above 'rc_dhcpcd_provide="!net"' dhcpcd is disabled as a provider which would then allow some other provider preference (ie, net.eth0 if it exists). 

 *steveL wrote:*   

> It seems to me that it'd be better to have another layer on top of net, called network, to allow plumbing etc to be setup after network connections, and before servers requiring IP addresses. (Or change net to phy.)

 

Not sure I understand ... there are a number of "layers" provided by openrc: before, after, depend, provide, need, use, etc ... in the case of 'net' and its being provided by dhcpcd, its just a fallback should nothing else be available and though I'm a little unimpressed by this kind of automagic (it should probably just fail imo) it seems like it was introduced to cover situations where 'net.xxxxx' may be (un-)predictable :) 

best ... khay

----------

## GOS

I think it means that in my case /etc/init.d/net.xyz was not startet with the configuration in /etc/conf.d/net before the world update. Probably the world update fixed this problem and therefore dhcpd wasn't used again. 

Thanks for explanations.

GOS

----------

## steveL

 *khayyam wrote:*   

> As '/etc/init.d/net.ethX' may not exist, if anything 'need[s] net' then dhcpcd is the default provider (as it will automatically detect and manage interfaces). net.eth0 can't 'provide net' as its only there if and when the user makes the symlink, whereas the dhcpcd service is there given the user has installed the package.

 

Hmm automatically detect and manage interfaces sounds nice, and rings a bell. I think this is the gentoo-net ("old-net") thing in action then, and the idea was for it to be dropped and people move to dhcpcd, which was also Roy Marple's plan ("uberLord" iirc.)

The !foo makes sense, thanks.

----------

