# dhcpcd 5.2.8 provides 'net' when existing 'net' exists

## lyallp

Every time I start a service now, I see

```
 *  Cannot add provide 'net', as a service with the same name exists!
```

Suggestions as to how I go about fixing this?

I was thinking simply removing the 'provides'.

----------

## richard.scott

yep, that would work... also try posting a bug report too.

----------

## lyallp

I am never sure that I have a bug or just my screwing around with the system, hence I tend to ask in the forums first. 

I will post a bug later today.

----------

## lyallp

Bug 346805 raised.

----------

## figueroa

I'm not sure I'm even using the new /etc/init.d/dhcpcd  When I check it's status, it's not running, although ps ax | grep dhcpcd shows that the program is running.  Commenting out "provide net" does not seem to have any consequence other than elimination of the error message on starting a service.

----------

## chiefbag

dhcpcd is a daemon for running a dhcp server it does not need to be running if you are a client machine. 

If you post the output of ifconfig you should see that your nic has picked up an ip using dhcp. 

The new ip will only be renegoicated once you restart the nic.

----------

## doctork

 *chiefbag wrote:*   

> dhcpcd is a daemon for running a dhcp server it does not need to be running if you are a client machine. 
> 
> If you post the output of ifconfig you should see that your nic has picked up an ip using dhcp. 
> 
> The new ip will only be renegoicated once you restart the nic.

 

No,  dhcpcd is the dhcp CLIENT daemon (see man dhcpcd).  Presumably it is started when net.eth? is started.  The dhcp server is called dhcpd.  I run that on my firewall/router/NAT system to provide addresses and internet access to the rest of my menagerie.

--

doc

----------

## richard.scott

you don't have to be running the service for the error to show up. There is an incorrect line in /etc/init.d/dhcpcd that states "provides net" and this is conflicting with the real net provider.

Rich

----------

## UberLord

When dhcpcd is started from init.d/dhcpcd it monitors all interfaces and configures them correctly. If wired and wireless are both connected, it will prefer wireless.

Think of networkmanager in 60k. If you install dhcpcd-ui you even get a nice GTK+ systray icon with basic configuration screens.

As such, dhcpcd providing net is the correct thing to do.

This design conflicts with the net.* init.d scripts. So if you use dhcpcd like this, remove all net.* except for net.lo (net.lo0 on BSD).

If you don't use this, simply don't add dhcpcd to any runlevels (which is the default) and OpenRC gets it right.

I suspect the OP is using baselayout-1 where this error may indeed happen.

----------

## lyallp

FYI: I do use baselayout-1.12.14-r1 - baselayout2 is ~x86 and I have a limited number of packages ~x86

----------

## toralf

 *UberLord wrote:*   

> When dhcpcd is started from init.d/dhcpcd it monitors all interfaces and configures them correctly. If wired and wireless are both connected, it will prefer wireless.

 This might work in the office, but doesn't work for a notebook plugged into a docking station connected to a simple ADSL modem at home.

 *UberLord wrote:*   

> I suspect the OP is using baselayout-1 where this error may indeed happen.

 Yes

----------

## UberLord

 *toralf wrote:*   

>  *UberLord wrote:*   When dhcpcd is started from init.d/dhcpcd it monitors all interfaces and configures them correctly. If wired and wireless are both connected, it will prefer wireless. This might work in the office, but doesn't work for a notebook plugged into a docking station connected to a simple ADSL modem at home.

 

Why not?

----------

## toralf

 *UberLord wrote:*   

> Why not?

 Well - good question, sI've the (working) config file:

```
config_eth0=( "192.168.0.254/16" )

...

config_ppp0=( "ppp" )

link_ppp0=( "eth0" )

plugins_ppp0=( "pppoe" )

...

modules=( "wpa_supplicant" )

config_wlan0=("dhcp" )

...

postup() {

        if [[ "$IFACE" = "eth0" ]]; then

                change_resolv.sh

                if [[ "$(cat /sys/bus/platform/devices/dock.0/docked)" = "1" ]]; then

                        /etc/init.d/net.ppp0  restart

                else

                        #       at office start wlan0 if no route is given to the office net

                        #

                        /sbin/route -n | grep -q -e "^9\."

                        if [[ $? -ne 0 ]]; then

                                /etc/init.d/net.wlan0 restart

                        fi

                fi

        elif [[ "$IFACE" = "ppp0" ]]; then

                change_resolv.sh

        fi

}
```

which satisfies my needs - I can s2ram my notebook at work, plug it at home into the docking station and wake it up (using baselayout 1). Would dhcpcd makes this configuration easier ?

----------

## UberLord

No, dhcpcd would not make that any easier.

I'm wondering why they all need restarting though. Can't you just start all of them and let them work it out?

----------

