# [SOLVED] Don't start dhcp at bootup

## Manu311

Hi,

I've set up my laptop with gentoo, installed everything needed and I want to configure my network with wicd, wicd depends on dhcpcd, so I had to install that.

But now everytime I start my system, it initiates dhcpcd (which isn't in any runlevel). This also happens when I (re)start sshd. When I unemerge dhcpcd everything is working as I want it - no error nothing.

But I'll need a dhcp client in the future, so that's no alternativ (it will be reinstalled everytime I emerge update anyways).

So I've been searching for days now where this is configured to do so.

The only clue so far was /etc/conf.d/net which was entirely empty but the comments in it tells me that will cause it to run dhcp on any device, so I changed added: eth0_config=( "null" ) - which didn'T worked, I changed the null to an ip, which still didn't work.

I'm sure there must be a hint somewhere, but I just can't find it.

Thanks for any help.Last edited by Manu311 on Fri Jun 03, 2011 7:24 pm; edited 1 time in total

----------

## audiodef

If you're not married to Wicd, try NetworkManager. Search for "gentoo networkmanager howto" and you'll find all the info you need on getting a nice connection manager up and running. 

I used to like Wicd, but lately it seems that NetworkManager just works better and doesn't have the "problems" Wicd sometimes has.

----------

## rh1

Whether the OP is using wicd or networkmanager has nothing to do with dhcpcd starting. I think it has to do with the init script but can't check right now

----------

## Manu311

And what if I'm engaged with wicd?  :Razz: 

Anyways it's not gonna help, I'll still need a dhcp client and it looks like networkmanager also depends on dhcpcd, so it's the same thing.

The problem appears also if I don't start wicd or even remove it entirely.

wicd itself works as expected (so far).

----------

## dmpogo

 *Manu311 wrote:*   

> Hi,
> 
> I've set up my laptop with gentoo, installed everything needed and I want to configure my network with wicd, wicd depends on dhcpcd, so I had to install that.
> 
> But now everytime I start my system, it initiates dhcpcd (which isn't in any runlevel). This also happens when I (re)start sshd. When I unemerge dhcpcd everything is working as I want it - no error nothing.
> ...

 

I believe that if the interface requires dhcp (empty config in /etc/conf.d/net will do for that), the dhcpcd will be run when interface is brought up.  So you should be looking into different question - how not to bring up interfaces on boot.

For example, by using ifplugd, or not having network /etc/init.d/net.... in the boot sequence and lauching them later separtely.  I don't know how wicd works though

----------

## Manu311

 *dmpogo wrote:*   

> how not to bring up interfaces on boot.
> 
> For example, by using ifplugd, or not having network /etc/init.d/net.... in the boot sequence and lauching them later separtely.  I don't know how wicd works though

 

There is no /etc/init.d/net.... file which is in any runlevel

Anyways it's not just at boot, it also starts anytime I start sshd.

If I /etc/init.d/dhcpcd stop that will also stop sshd, and if I restart sshd that will start dhcpcd again - the only way, I found so far, is to remove dhcpcd entirely, and I don't want to do that (since neither networkmanager nor wicd work and ofc dhcp doesn't no matter how I try it).

Oh and my wired connection will most likely never need dhcp, and my wireless not often (currently I haven't installed wireless at all), so it doesn't NEED dhcp, so why should I waste my resources on dhcp when I simply don't need it? I'm not at windows after all.

----------

## dmpogo

1) I mean /etc/init.d/net.eth0 or /etc/init.d/wlan0

you don't have those ?

2) Are you saying you have dhcpcd in the default/boot runlevel ?

You should not,   do rc-update del dhcpcd default

3)  sshd requires 'net' .  'net' can be provided by many packages, dhcpcd provides net,  net.eth0 provides net.

If you stop the last service that provides net, it has to take down sshd as well.

4) how is your wired connection configured ?

----------

## Manu311

 *dmpogo wrote:*   

> 1) I mean /etc/init.d/net.eth0 or /etc/init.d/wlan0
> 
> you don't have those ?
> 
> 2) Are you saying you have dhcpcd in the default/boot runlevel ?
> ...

 

Thanks a lot, I still have no clue what exactly "net" is, but after I readded net.eth0 to a runlevel dhcpcd stopped beeing autostarted.

That fixed it, thank you.

----------

## dmpogo

 *Manu311 wrote:*   

> 
> 
> Thanks a lot, I still have no clue what exactly "net" is, but after I readded net.eth0 to a runlevel dhcpcd stopped beeing autostarted.
> 
> That fixed it, thank you.

 

gentoo init scripts have a system of dependencies between scripts which are set by using 'need something' 'use something' 'provide something' directives.

Look inside /etc/init.d/sshd   and see that it has   'need net' statement.

That means that sshd can start only after some other service which has 'provide net' started before. Thus starting sshd will start some service which 

'provides net' among the configured ones if none are running already.   Similarly shutting down the last service that 'provide net' will shutdown all services that 'need net', since, supposedly, they can't run without.

It is semi-manual way to set up dependencies, but it works.

'net' here is just a keyword.

Usually 'net' is provided by one of the interface scripts /etc/init.d/net.eth0 which are usually in default level and are started. In your case, the only script that had 'provide net' in it was dhcpcd. so it had to carry this responsibility.

'use something'   is weaker than 'need'.  It says that the script can use something, but can run without it as well.

----------

