# net.wlan0 getting backgrounded on boot

## durty_nacho

Is there a way to have network dependent services like CIFS to not only wait on network adapters to start, but also to be connected and functional? After removing net.eth0 from startup (which was causing long delays due to dhcpcd), the wireless NIC now starts and doesn't connect in time before the rest of the system is booted, causing CIFS failures. After I login things are good but I have to mount network shares manually. This is fine, but I'd like to figure out how to make it all work at boot.

----------

## VinzC

What would you call "long delays"?

----------

## durty_nacho

It is the usual delay from eth0 trying to pull a dhcp address; I have to wait for it to timeout before the system will continue to boot. I configured ifplugd and took net.eth0 out of the default run level and it no longer starts at boot. 

The problem I think is that now, for some reason, when wlan0 starts it doesn't connect in time. This causes CIFS to attempt to mount a network share that I have configured in fstab and it fails because the network isn't ready. I am not sure why having eth0 out of the run level is causing this. At first I thought that while eth0 was trying to pull a dhcp address, wlan0 was in the background connecting, but it couldn't be as it was starting after eth0. When eth0 was in the default run level, after it timed out wlan0 would start and connect right away.

----------

## VinzC

The biggest question is why does eth0 time out and so wlan0. Did you notice anything special about that? or is it happening because the computer is away from any network?

----------

## durty_nacho

Yeah, I failed to mention that this is my laptop and the Ethernet adapter is not connected most of the time. So when it comes up it tries to pull a dhcp address and times out. I read somewhere that dhcpcd is supposed to be smart enough to realize its not connected, but it doesn't seem to notice.

----------

## durty_nacho

It turns out that wlan0 is getting backgrounded at boot. How can I prevent this?

----------

## Logicien

The --timeout 0 or -t 0 option make dhcpcd wait forever for a lease. Logically, at the same time it suppose to prevent dhcpcd to go in background.

----------

## VinzC

I would run CIFS mount commands in local.start for that's the best place I know of that gives me enough freedom for checking if the network is actually accessible or not. The reason is if dhcpcd times out it'll use APIPA — unless you tell it not to with dhcpcd option -L, of course; I don't remember the option name in Gentoo's network scripts for I completely rewrote the network handling scripts.

----------

