# net.wlan0 has started, but is inactive

## emc

I did:

https://forums.gentoo.org/viewtopic-t-900156-highlight-.html

But still during boot i got problems:

```
 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

 [ ok ]

 *   Starting wpa_cli on wlan0 ...

 [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive

 * Setting clock via the NTP client 'ntpdate' ...

Error resolving 0.gentoo.pool.ntp.org: Name or service not known (-2)

Error resolving 1.gentoo.pool.ntp.org: Name or service not known (-2)

Error resolving 2.gentoo.pool.ntp.org: Name or service not known (-2)

Error resolving 3.gentoo.pool.ntp.org: Name or service not known (-2)

 * Failed to set clock

 [ !! ]

 * ERROR: ntp-client failed to start

 * Starting rpcbind ...

 [ ok ]

 * Starting NFS statd ...

 [ ok ]

 * Starting NFS sm-notify ...

 [ ok ]

 * Mounting NFS filesystems ...

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

 [ !! ]

 * ERROR: nfsmount failed to start

 * Mounting network filesystems ...

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

mount.nfs: Failed to resolve server flap: Temporary failure in name resolution

 [ ok ]

 * Starting gpm ...
```

After booting I can start all services without problem:

```
/etc/init.d/nfsmount start

 * Starting NFS sm-notify ...   [ ok ]

 * Mounting NFS filesystems ...   [ ok ] 

meee ~ # /etc/init.d/ntp-client start

 * Setting clock via the NTP client 'ntpdate' ...   [ ok ]
```

Even when:

```
meee ~ # rc-status | grep wlan0

 net.wlan0                                                         [ inactive  ]
```

Why it happend? My wifi network isn't running during boot, it take longer to start or what? Probably answer is to easy?

----------

## NeddySeagoon

emc,

The errors point either to no network or no nameserver entries in /etc/resolv.conf but its resolved wgen you can log in and start the services by habd.

What do you have in /etc/rc.conf

and what does rc-update show --verbose produce ?

Lastly, do you have an unused wired Ethernet interface ?

----------

## emc

My rc.conf

My rc-update

Sometimes I connect wired but not offen. what you really mean, how to check it?  :Wink:  When I connect cable it came up.

----------

## NeddySeagoon

emc,

```
wicd |         boot 
```

looks a bit odd.

Isn't wicd a network manager of some sort?

If so, it should probably be in the default and battery runlevels, not boot. as you don't want to force networking to start in the boot runlevel.

----------

## emc

I've change wicd run in battery and default runlevel but it didn't help. Any way it look like wps_supplicat problem or sort of, after boot I got

```
meee ~ # /etc/init.d/net.wlan0 restart

 * Bringing down interface wlan0

 *   Stopping dhcpcd on wlan0 ...                                                                                     [ ok ]

 *   Removing addresses

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...                                                                             [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                                                    [ ok ]

 *   Backgrounding ... ...

 * WARNING: net.wlan0 has started, but is inactive
```

And I see similar massages during booting. It's inactive but I get connected.

Any suggestions??

----------

## NeddySeagoon

emc,

I get that too - but it works, so I just ignore the warning.

----------

## emc

NeddySeagoon:

OK, but the point is I can't mount NFS shares during boot or run NTP to update system clock, it sounds insane to me  :Neutral: 

----------

## mr.sande

 *emc wrote:*   

> NeddySeagoon:
> 
> OK, but the point is I can't mount NFS shares during boot or run NTP to update system clock, it sounds insane to me 

 

Mounting NFS over WiFi on boot has a tendency to make you unhappy, everytime you get disconnected you get trouble from NFS.

WiFi just isn't reliable enough to do NTP or NFS over at boot  :Sad:  One problem is that when the net.wlan0 script is done, as in when 

it says

```
 *   Backgrounding ... ... 

 * WARNING: net.wlan0 has started, but is inactive
```

there is no guarantee that the connection is actually ready. And when the network services start they assume that the connection 

is up, and they fail because the link isn't ready yet.

----------

## greyspoke

I noticed this issue when I went wireless.  RC doesn't wait for net.wlan0 to finish before moving on (probably as it is unreliable as mr.sande said above), which is where that message comes from.

To give NTP a reasonable chance of starting, don't run the NTP init script, start the daemon using the postup function in your conf.d/net (I found that on this forum somewhere but can''t find it now).  Here's mine, which just runs a quick and dirty one-off clock check.  At least I think it does - /etc/conf.d/net snippet:

```
postup() {

   if [ ${IFVAR} != "lo" ]; then

# (long wait if you do this with net.lo)

      sntp -s -p ntp.plus.net

   fi

}

```

that's my ISPs time server there, would be different for you.  I guess you could do the same with network mounts.

----------

## NeddySeagoon

emc,

You can try to background your nfs mounts.  Add the bg option to /etc/fstab.

I have a horrible feeling that this won't work for root over nfs as /etc/fstab is not used to mount root.

----------

## new_item

Maybe changing (in /etc/init.d/nfsmount) this:

```

mount -a -t nfs,nfs4

```

into something like that:

```

start() {

(...)

        ebegin "Mounting NFS filesystems"

        $( $( if [ x"`ping -c1 192.168.1.9 | grep -w Unreachable`" == x"0" ]

        then mount -a -t nfs,nfs4 && exit

        else sleep 3

        fi ) & )

        eend $?

}

```

will help you. Please remember to change IP in scritpt into your nfs server IP. It have to be IP number not name of the host. I didn't check if script works, but it looks reasonably.

----------

## emc

I did something like:

```
start() {

        ebegin "Starting..."

        #start-stop-daemon --start --quiet --background --exec

        PING=`ping -W1 -c1 89.16.167.13 | grep "received" | cut -d" " -f4`

        if [ $PING -eq 1 ]; then

                <COMMANDS HERE> &>/dev/null

                return 0

        else

        #if [ $PING -eq 0 ]; then

                for i in {1..3}

                do

                        sleep 1

                        PING=`ping -W1 -c1 89.16.167.134 | grep "received" | cut -d" " -f4`

                        if [ $PING -eq 1 ]; then

                                <COMMANDS HERE> &>/dev/null

                                return 0

                        fi

                done

                eerror "Failed to contact internet"

                return 1

        fi

        eend $?

}
```

*EDIT - I corrected script a bitLast edited by emc on Thu Aug 01, 2013 11:50 am; edited 2 times in total

----------

## emc

 *greyspoke wrote:*   

> 
> 
> ```
> postup() {
> 
> ...

 

Should I add it to /etc/conf.d/net file or somewhere in /etc/init.d/?

----------

