# [Solved] ntp-client fails to start during wireless boot...

## cgmd

Hi...

When I boot my laptop, hard wired to a network, all my networking features start up. If, however, I am not hard wired, but rely on my wireless (net.eth2), during boot, net.eth2 starts, and netmount, sshd and ntp-client fail to start:

```

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

 * Starting fcron ...                                                     [ok]

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

 * Starting postfix ...                                                   [ok]

 * Starting rsyncd ...                                                    [ok]

 * WARNING:  sshd is scheduled to start when net.eth0 has started.

 * Starting local ...                                                     [ok]

```

As seen, each service  is scheduled to start when net.eth0 has started.

If wireless is available, net.eth2 brings down an ip address without problem, and, once 

I have logged on, I am then able to manually start all three services.  :Confused: 

How can make these three services utilize net.eth2 during boot, when net.eth0 doesn't exist?

I have ifplugd installed, but may have it configured incorrectly:

```

# Define which interfaces we monitor

INTERFACES="eth0"

AUTO="no"

BEEP="yes"

IGNORE_FAIL="yes"

IGNORE_FAIL_POSITIVE="no"

IGNORE_RETVAL="yes"

POLL_TIME="1"

DELAY_UP="0"

DELAY_DOWN="0"

API_MODE="auto"

SHUTDOWN="no"

WAIT_ON_FORK="no"

MONITOR="no"

ARGS=""

# Additional parameters for ifplugd for the specified interface. Note that

# the global variable is ignored, when a variable like this is set for an

# interface

# MONITOR_wlan0="yes"

# DELAY_UP_wlan0="5"

# DELAY_DOWN_wlan0="5"

MONITOR_eth2="yes"

DELAY_UP_eth2="5"

DELAY_DOWN_eth2="5"

```

Does anyone have thoughts about this?

Thanks!

----------

## Skymotz

in my /etc/conf.d/net i have the following line for wlan:

ifplugd_eth1="--api-mode=wlan"

maybe this helps.

how did you create /etc/init.d/net.eth2 ?

i think it is supposed to be a link on net.lo

copying it would do the job, but if there is an update to the script etc-update will only update net.lo, so linking it will get you rid of copying every time. may it also plays a role in your problem, i don't know. i know the message you get, it always defaults to net.eth0. i get it most times i start up only with wlan but as soon as my wlan interface is up (which usually takes longer than hardwired) the services start. this is because every /etc/init.d/net.* gives you the virtual dependency "net" (except net.lo itself).

hope i could help

greets moritz

----------

## cgmd

 *Skymotz wrote:*   

> in my /etc/conf.d/net i have the following line for wlan:
> 
> ifplugd_eth1="--api-mode=wlan"
> 
> maybe this helps.
> ...

 

Thank you for your suggestion!

I don't remember the details of how I set up /etc/init.d/net.eth2, but it definitely is a link to net.lo, as you mentioned.

Since my hardwired network connects with net.eth0 and my wireless network connects with net.eth2, I tried to adapt  ifplugd_eth1="--api-mode=wlan" for use in /etc/conf.d/net:

```

ifplugd_eth0="--api-mode=eth2"
```

Unfortunately, this didn't correct the problem.   :Sad: 

It appears to me that net.eth2 isn't able to finish establishing an ip address, before the network services try to start, and they consequently fail.

I draw that conclusion, looking at the sequence of events in /var/log/messages:

```

Oct  4 17:19:38 cgmd ipw3945: Detected geography ABG (11 802.11bg channels, 13 802.11a channels)

Oct  4 17:19:38 cgmd udev: renamed network interface eth1 to eth2

Oct  4 17:19:39 cgmd rc-scripts: WARNING:  ntp-client is scheduled to start when net.eth0 has started.

Oct  4 17:19:39 cgmd fcron[5819]: fcron[5819] 3.0.2 started

Oct  4 17:19:39 cgmd fcron[5819]: updating configuration from /var/spool/cron/fcrontabs

Oct  4 17:19:39 cgmd fcron[5819]: adding file root

Oct  4 17:19:39 cgmd ieee80211_crypt: registered algorithm 'TKIP'

Oct  4 17:19:40 cgmd wpa_cli: interface eth2 CONNECTED

Oct  4 17:19:40 cgmd rc-scripts: WARNING:  netmount is scheduled to start when net.eth0 has started.

Oct  4 17:19:41 cgmd dhcpcd[6674]: eth2: dhcpcd 3.1.5 starting

Oct  4 17:19:41 cgmd dhcpcd[6674]: eth2: hardware address = 00:19:d2:85:9b:b2

Oct  4 17:19:41 cgmd dhcpcd[6674]: eth2: DUID = 00:01:00:01:0e:90:19:81:00:19:d2:85:9b:b2

Oct  4 17:19:41 cgmd dhcpcd[6674]: eth2: broadcasting for a lease

Oct  4 17:19:42 cgmd postfix/postfix-script: starting the Postfix mail system

Oct  4 17:19:42 cgmd postfix/master[6701]: daemon started -- version 2.3.6, configuration /etc/postfix

Oct  4 17:19:42 cgmd rsyncd[6763]: rsyncd version 2.6.9 starting, listening on port 873

Oct  4 17:19:42 cgmd dhcpcd[6674]: eth2: offered 192.168.1.100 from 192.168.1.1

Oct  4 17:19:42 cgmd dhcpcd[6674]: eth2: checking 192.168.1.100 is available on attached networks

Oct  4 17:19:42 cgmd rc-scripts: WARNING:  sshd is scheduled to start when net.eth0 has started.

Oct  4 17:19:43 cgmd dhcpcd[6674]: eth2: leased 192.168.1.100 for 86400 seconds

Oct  4 17:19:43 cgmd dhcpcd[6674]: eth2: adding IP address 192.168.1.100/24

Oct  4 17:19:43 cgmd dhcpcd[6674]: eth2: adding route to 192.168.1.0/24 metric 2000

Oct  4 17:19:43 cgmd dhcpcd[6674]: eth2: removing route to 192.168.1.0/24 metric 0

Oct  4 17:19:43 cgmd dhcpcd[6674]: eth2: adding default route via 192.168.1.1 metric 2000

Oct  4 17:19:59 cgmd fcron[6957]: Job /usr/sbin/logrotate  /etc/logrotate.conf started for user root (pid 6958)

```

Am I incorrect in my analysis?

Thanks!

----------

## cgmd

Guess I was correct in my assumption...  sleep 5, in /etc/init.d/ntp-client, seems to have fixed it:

```

 cat /etc/init.d/ntp-client

#!/sbin/runscript

# Copyright 1999-2007 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntp- client.rc,v 1.11 2007/03/09 17:24:28 vapier Exp $

depend() {

        before cron portmap

        need net

        use dns logger

}

checkconfig() {

        if ! type "${NTPCLIENT_CMD}" >/dev/null 2>/dev/null ; then

                eerror "Please edit /etc/conf.d/ntp-client"

                eerror "Unable to locate the client command ${NTPCLIENT_CMD}!"

                return 1

        fi

        if [ -z "${NTPCLIENT_OPTS}" ] ; then

                eerror "Please edit /etc/conf.d/ntp-client"

                eerror "I need to know what server/options to use!"

                return 1

        fi

        return 0

}

start() {

        sleep 10

        checkconfig || return $?

        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"

        "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS}

        eend $? "Failed to set clock"
```

...at least, for now!  :Confused: 

----------

