# ntp-client runs before net

## mrpringle

Hi,

I'm experiencing some issues where ntp-client is being executed before wlan0 has been assigned a dhcp address. This issue never happened when I was using the ethernet cable on my notebook so I can only assume it has something to do with the wireless. Here is part of my messages log from boot.

```

Dec 28 01:36:57 adam-nb wlan0: Initial auth_alg=0

Dec 28 01:36:57 adam-nb wlan0: authenticate with AP 00:1c:df:b1:3c:35

Dec 28 01:36:57 adam-nb wlan0: RX authentication from 00:1c:df:b1:3c:35 (alg=0 transaction=2 status=0)

Dec 28 01:36:57 adam-nb wlan0: authenticated

Dec 28 01:36:57 adam-nb wlan0: associate with AP 00:1c:df:b1:3c:35

Dec 28 01:36:57 adam-nb wlan0: RX AssocResp from 00:1c:df:b1:3c:35 (capab=0x431 status=0 aid=1)

Dec 28 01:36:57 adam-nb wlan0: associated

Dec 28 01:36:57 adam-nb wlan0: switched to short barker preamble (BSSID=00:1c:df:b1:3c:35)

Dec 28 01:36:57 adam-nb ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Dec 28 01:37:00 adam-nb ntpdate[5837]: name server cannot be used, reason: Temporary failure in name resolution

Dec 28 01:37:00 adam-nb rc-scripts: Failed to set clock

Dec 28 01:37:00 adam-nb wpa_cli: interface wlan0 CONNECTED

Dec 28 01:37:00 adam-nb ntpd[5921]: ntpd 4.2.4p5@1.1541-o Mon Dec 15 04:26:49 UTC 2008 (1)

```

How can I make sure that ntp-client isn't started before the wireless has connected.

----------

## feiticeir0

Hi.

Edit the file 

```
/etc/init.d/ntp-client
```

 and search for a depend bloc. Something like:

(this one is from hald - just an example)

```

depend() {

        use logger acpid

        need dbus

        after coldplug dns nscd

}

```

Do you see the line after coldplug dns ...? in the ntp-client add the word net. save and try

Cheers,

FT

----------

## mrpringle

 *feiticeir0 wrote:*   

> Hi.
> 
> Do you see the line after coldplug dns ...? in the ntp-client add the word net. save and try
> 
> 

 

This didn't seem to help. Any other ideas.

Can someone show me their conf.d/net configuration which uses the wpa_supplicant drivers.

----------

## toralf

Probably you have to  set this

```
tfoerste@n22 ~ $ grep RC_NET_STRICT_CHECKING= /etc/conf.d/rc

RC_NET_STRICT_CHECKING="no"

```

to "yes" ?

----------

## mrpringle

THanks for the suggestion. I gave this a try and now I get some warning at startup.

```

WARNING: netmount is scheduled to start when net.wlan0 has started.

WARNING: ntp-client is scheduled to start when net.wlan0 has started.

WARNING: ntpd is scheduled to start when net.wlan0 has started.

```

I'm not sure why they are appearing and whether they are a problem or not.

I also tried using ifplugd to handle the network interfaces on startup, but I get similar warnings to what is shown above.

Any ideas?

----------

## andron

Try to add this to /etc/conf.d/net.

```
associate_timeout_wlan0=60
```

Maybe this helps.

----------

## manwithaplan1976

Try adding this line to your /etc/conf.d/net

```

 postup() {

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

        # Wait for connection to be ready 

        sleep 5

    fi

    return 0
```

This is what I use for a ntp delay before dhcp pulls an IP... You can change "eth0,1,2 .. wlan0,1,2.. etc"  Also the sleep, which is in seconds.. I use 3sec. it seems to be fine. I still get a 24 sec bootup time. Basically what this does is delays ntp for 5 seconds until an IP address is assigned.

----------

