# Cannot add provide 'net'

## Gandalf the White

Okay, since my router died and I am forced to use rp-pppoe, rc-update always gives an error: "Cannot add provide 'net', a service with that name already exists". This error also appears during startup, at the "Calculating Service Dependencies" bit. Any ideas?

----------

## icywolf

same problem I'm trying to install gentoo (using gentoo replacing the livecd)

----------

## Gandalf the White

:bump: ?

----------

## chrisyu

I have this problem too.

In "/etc/init.d/rp-pppoe", I changed the line in depend section from "provide net" to "need net". 

The error message dispears.

But I don't know whether this is the right way.

----------

## Gandalf the White

Even with this error rp-pppoe works great so as long as the message is gone, good enough for me   :Laughing:   thanks!

----------

## don quixada

 *chrisyu wrote:*   

> 
> 
> In "/etc/init.d/rp-pppoe", I changed the line in depend section from "provide net" to "need net". 
> 
> 

 

This solution does not work for me. I'm getting the message twice!:

```

>>> Regenerating /etc/ld.so.cache...

 * Caching service dependencies...

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

>>> Regenerating /etc/ld.so.cache...

 * Caching service dependencies...

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

```

There's gotta be other people here getting this problem...

dq

----------

## wolvie

hello..

i made a fix myself but this will probaly break something.. for now seens ok to me.. what i made was change 

```
provide net
```

to

```
provide network
```

on /etc/init.d/rp-pppoe and also all the

```
need net
```

entries on /etc/init.d/* to

```
need network
```

i could make a diff from the original /etc/init.d but as i said this "fix" might break something as long as FOR ME it works well, so i think it's better each one decides what's better to do.. or call a developer to show the box on fire -=;oP

if someone want to try but dunno how i can pass a 3 lines script to make things easier..

regards..and sorry my poor english -=;oP

cya

----------

## jwdonal

My fix was to simply reboot the machine.  I was receiving exactly the same error as all of you but I found another forum that stated that this error can occur if the network interface does not start up on boot.  If you start the device after boot (i.e. after you login, using /etc/init.d/eth0 start) this error can occur.  It happens because the 'net' process is already started or something like that.  I really don't know specifically what scenario or combination of settings causes the problem but I just thought I would post my solution and findings here in case it helps someone else.

----------

## KAMIKAZE_

got this error too

----------

## Lori

From bug #346805:

"When two init.d scripts have "provide net" then baselayout-1 will complain (but not fail). The cause is known, but the solution proves difficult to implement (either we can get the init.d script to recognise the baselayout version, or much easier, get baselayout-2 stable,)."

----------

## Wilhelm

I have the same problem. Solved the bug.

In my case it was dhcpcd which contained "provide net".

----------

## Gentree

 *Wilhelm wrote:*   

> I have the same problem. Solved the bug.
> 
> In my case it was dhcpcd which contained "provide net".

 

Exact same problem here. 

provides network results in dhcpcd saying it can' reference itself. 

So what was the solution?   :Confused: 

thx

----------

## Adam.

For me the solution was

rc-update del net-eth0 default

Since eth0 is a device initiated service it is started anyway.

----------

## Gentree

 *Gentree wrote:*   

>  *Wilhelm wrote:*   I have the same problem. Solved the bug.
> 
> In my case it was dhcpcd which contained "provide net". 
> 
> Exact same problem here. 
> ...

 

OK, I found that removing /etc/init.d/dhcpcd got around the problem , although it obviously needs to be hacked by hand each time there's an update. 

Then consolekit can start correctly if added to default runlevel.

Not very satisfactory but working.

----------

## tonyp

This worked for me as well.

 *Adam. wrote:*   

> For me the solution was
> 
> rc-update del net-eth0 default
> 
> Since eth0 is a device initiated service it is started anyway.

 

----------

## Gentree

```
Joined: 27 Apr 2005

Posts: 2
```

this is your second posting since joining in 2005 ?

I'm sure that must win some prize. Is the Guiness book of records aware of this outstanding feat?

----------

## VovikE

env-update ?

----------

## Gentree

 *VovikE wrote:*   

> env-update ?

 

env-update ?

----------

## Killerchronic

 *VovikE wrote:*   

> env-update ?

 

This fixed all the problems for me, then just went through and restarted services.

----------

## eulogious

I tried deleteing net.eth0 from my default run level in hopes it would be that easy, I also rebooted, and I was still getting this error.  I was able to track mine down to /etc/init.d/dhcpd.  I commented out the "provide net" line, and all is well  :Very Happy: 

```

#!/sbin/runscript

# Copyright 2007-2008 Roy Marples <roy@marples.name>

# All rights reserved. Released under the 2-clause BSD license.

command=/sbin/dhcpcd

pidfile=/var/run/dhcpcd.pid

command_args=-q

name="DHCP Client Daemon"

depend()

{

#   provide net

   need localmount

   use logger network

   after bootmisc modules

   before dns

}

```

This is the answer.  Just don't need "provide net" in more than one place, and tells us the fix...

 *Lori wrote:*   

> From bug #346805:
> 
> "When two init.d scripts have "provide net" then baselayout-1 will complain (but not fail). The cause is known, but the solution proves difficult to implement (either we can get the init.d script to recognise the baselayout version, or much easier, get baselayout-2 stable,)."

 

This helped me understand as well...

From bug #346805 as well...

 *Quote:*   

> Actually, messing with the init script is not the correct solution. That line
> 
> should say "provide net".
> 
> If you are trying to add the dhcpcd init script to the runlevels, you are
> ...

 

The latter part doesn't apply to me, as udev starts eth0 for me, and then dhcpd is kicked off as well, so no net.* services are started by using init.d scripts (well, net.lo has to start at boot vi init.d, I can't figure out how else to start it).  But it helped me understand the logic behind the "provide net" statement and what it was doing so I could track down what was going on.

I am sure I could track down which other script has the "provide net" line in it, but I found dhcpd first, so that's the one I changed.  If you are still having this problem after commenting out "provide net", it's most likely because it is in more than one script.  Find the other instances of "provide net", and comment them out leaving only one, and the error should go away.  That is until the next update...    :Rolling Eyes:   It's a hack, but it works.

Let's hope baselayout2 becomes stable soon, and then this won't matter...

----------

## Gentree

@eulogiou, just delete  /etc/init.d/dhcpcd as I posted above. Equally much a hack, equally unsatisfactory but it seems it's the best Gentoo has to offer just now.

 :Sad: 

 *Gentree wrote:*   

>  *Gentree wrote:*    *Wilhelm wrote:*   I have the same problem. Solved the bug.
> 
> In my case it was dhcpcd which contained "provide net". 
> 
> Exact same problem here. 
> ...

 

----------

## eulogious

 *Gentree wrote:*   

> @eulogiou, just delete  /etc/init.d/dhcpcd as I posted above. Equally much a hack, equally unsatisfactory but it seems it's the best Gentoo has to offer just now.
> 
> 

 

For sure deleting the entire script will make the message go away, just like a 12lbs sledge hammer will kill a fly.  It's overkill, but it gets the job done   :Wink: 

I like having the script around, if for nothing else it's a reminder that it's installed.  I am also anal when it comes to my system, so I don't like deleting scripts, even if they really don't do anything, but that's just me  :Very Happy: 

At least I don't get that stupid message anymore  :Smile: 

----------

## Warhead

I ran into this issue when trying to use the teamspeak3 server runscript. I fail to see, what to do from here. Do I need to modify the runscrip? Do I have to rename / remove some net services? Can the runscript not be used at the moment due to this error? Google does not find any references regarding this error and teamspeak, but I do not think I am the only one with this. Any help is gladly apreciated.

Regards

Lorgarn

----------

## ocZer

I ran into the same problem myself. Solved it by removing all net.* devices from default runlevel and also removing dhcpcd and netmount. 

Net.eth0 and net.wlan0 are device initiated. When it cant find a config file to set up dhcp it starts dhcpcd by itself.

----------

## Warhead

 *ocZer wrote:*   

> I ran into the same problem myself. Solved it by removing all net.* devices from default runlevel and also removing dhcpcd and netmount. 
> 
> Net.eth0 and net.wlan0 are device initiated. When it cant find a config file to set up dhcp it starts dhcpcd by itself.

 

The machine provides routing so it has no DHCP client demon. Can not remove the DHCP or PPPOE, have to keep uo both eth devices (one for the pppoe connection to the outside world and one to the LAN). Is the use of more then one net.* runscripts incorrect? Or is this a workaround because the behavior is a bug?

Regards

Warhead

----------

## ocZer

I dont think it's a bug really, but im no expert. I think it's just warning that a service has been started twice. 

Could u maybe give us the output of your init log and 

```
rc-update show default
```

----------

## Warhead

 *ocZer wrote:*   

> rc-update show default

 

Here it is:

```

# rc-update show default

             apache2 | default

               dhcpd | default

            iptables | default

               local | default

               mysql | default

               named | default

            net.eth1 | default

            netmount | default

               pppoe | default

                sshd | default

           syslog-ng | default

      udev-postmount | default

          vixie-cron | default

#

```

Regards

Warhead

----------

## ocZer

It appears that the reason for the message is the same on yours as it was on mine, but as you mention that u cannot remove dhcpd because it works as a routing device im not certain how to go around it. 

I understand that you have a second network card then, but i cannot see it listed. It's probably called up by udev. On my setup all network cars are called by udev and i didnt have to add them with rc-update. dhcpd is called by the network card itself on boot. If you can make your eth1 device also work this way you could remove them from rc-update.

----------

## Warhead

 *ocZer wrote:*   

> It appears that the reason for the message is the same on yours as it was on mine, but as you mention that u cannot remove dhcpd because it works as a routing device im not certain how to go around it. 
> 
> I understand that you have a second network card then, but i cannot see it listed. It's probably called up by udev. On my setup all network cars are called by udev and i didnt have to add them with rc-update. dhcpd is called by the network card itself on boot. If you can make your eth1 device also work this way you could remove them from rc-update.

 

You are right. I will try to get the device up via udef. Can this have an effect on pppoe on the device? Or is there no difference to pppoe how the device was brought up?

Regards

Warhead

----------

## ocZer

Im not certain how this would affect pppoe. I have never used this directly from pc, but always had a router to do the job.

----------

## klhsieh

 *jwdonal wrote:*   

> My fix was to simply reboot the machine.  I was receiving exactly the same error as all of you but I found another forum that stated that this error can occur if the network interface does not start up on boot.  If you start the device after boot (i.e. after you login, using /etc/init.d/eth0 start) this error can occur.  It happens because the 'net' process is already started or something like that.  I really don't know specifically what scenario or combination of settings causes the problem but I just thought I would post my solution and findings here in case it helps someone else.

 

Jwdonal's solution works for me!

Originally, my syslog-ng has wrong configuration. After I fixed the conf file, I get "Cannot add provide 'net', as a service with the same name exists!" error.

I have tried above methods but they did not work.

After rebooting, those problem have gone and my apache can work!

----------

