# [solved]wpa_supplicant doesn't start from net.wlan0

## Heimfrost

Hello experts,

my problem is, that wpa_supplicant won't started from the init script, even though I have specified it in /etc/conf.d/net as a module.

Net.wlan0 is starting successfully, but there's no message, that wpa_supplicant has been started and there's no wpa_supplicant process or dmesg output of connection things.

Thatswhy I assume, wpa_supplicant isn't started by net.wlan0.

If I start it manually with:

```
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
```

all is working fine. The AP appears and it is connected to it, therefore I assume, there exist no wpa_supplicant.conf or wireless extensions/kernel problem.

How can I "teach" the init script, it should start wpa_supplicant ? Why doesn't it find wpa_supplicant, obviously and how could I get an error message, because nothing is shown up ?

The only message I get is something like "wlan0 started successfully with IP ...".

my /etc/conf.d/net:

```
modules=( "wpa_supplicant" )

config_eth0="192.168.0.1"

config_wlan0="192.168.1.3 netmask 255.255.255.0"

routes_wlan0="default via 192.168.1.1"

wpa_supplicant_wlan0="-Dwext"

#config_wlan0=( "dhcp" )
```

I have to say, it's a new Gentoo install and I have remerged wpa_supplicant and net-tools and deinstalled wireless-tools after this behaviour, but with no effect.

I have no idea.Last edited by Heimfrost on Mon Jul 12, 2010 7:46 pm; edited 1 time in total

----------

## Jimini

First of all, tell your wireless device to use wpa_supplicant:

/etc/conf.d/net

```
config_wlan0=( "dhcp" )

modules_wlan0=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"
```

Then, edit /etc/wpa_supplicant/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

eapol_version=2

update_config=1

network={

        ssid="youressid"

        psk="password"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=TKIP

        group=TKIP WEP104 WEP40

}
```

(I use WPA-PSK with an ascii-passphrase)

Works fine for me.

Have you looked into the following howtos yet?

http://en.gentoo-wiki.com/wiki/Wireless_Networking#WPASupplicant

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4#doc_chap2

Best regards,

Jimini

----------

## d2_racing

Hi, what happens when you run this :

```

# /etc/init.d/net.wlan0 restart

# iwconfig

# wpa_cli status

# dmesg | tail

```

----------

## Heimfrost

 *Jimini wrote:*   

> First of all, tell your wireless device to use wpa_supplicant:
> 
> /etc/conf.d/net
> 
> ```
> ...

 

same above result with this, it doesn't start and the dhcp fails, because wpa_supplicant doesn't start. Thatswhy I made a manual IP for wlan0.

 *Jimini wrote:*   

> 
> 
> Then, edit /etc/wpa_supplicant/wpa_supplicant.conf
> 
> ```
> ...

 

For me too, like I wrote, if I start manually, it works (nearly the same config of wpa_supplicant.conf here).

 *Jimini wrote:*   

> 
> 
> Have you looked into the following howtos yet?
> 
> http://en.gentoo-wiki.com/wiki/Wireless_Networking#WPASupplicant
> ...

 

yes

 *d2_racing wrote:*   

> 
> 
> Hi, what happens when you run this :
> 
> ```
> ...

 

/etc/init.d/net.wlan0 restart:

```
Starting wlan0

Bringing up wlan0

dhcp

Running dhcpcd ...

wlan0: dhcpcd 4.0.15 starting

wlan0: waiting for carrier

wlan0: timed out
```

iwconfig:

```

lo        no wireless extensions

eth0    no wireless extensions

wlan0  IEEE 802.11bg  Mode:Managed  Access Point: Not-Associated

          Tx-Power=13 dBm

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

```

wpa_cli status:

```
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
```

dmesg | tail:

```
[    6.728855] sd 4:0:0:0: [sdc] Mode Sense: 43 00 00 00

[    6.728858] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[    6.732729] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[    6.732732]  sdc: sdc1 sdc2

[    6.736609] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[    6.736613] sd 4:0:0:0: [sdc] Attached SCSI removable disk

[    7.088333] EXT4-fs (sdb2): mounted filesystem with ordered data mode

[    7.176638] Adding 4200956k swap on /dev/sdb1.  Priority:-1 extents:1 across:4200956k 

[   13.497816] eth0: link down

[   17.240844] rt61pci 0000:00:0c.0: firmware: requesting rt2661.bin
```

It seems something neccessary or Path is missing before. If I start net.wlan0 within a chroot at my installed Ubuntu, then it starts wpa_supplicant.

I don't know what could be that one.

----------

## Jimini

 *Heimfrost wrote:*   

> It seems something neccessary or Path is missing before.

 

Here a wrong path is mentioned (see comment #6):

I encountered a similar bug two days ago on a fully updated ~amd64 system. 

Starting net.wlan0 would not start wpa_supplicant, so dhcp would fail.  I

eventually traced the problem to an incorrect path in /lib64/rc/cache/nettree

which pointed to /sbin/wpa_supplicant rather than /usr/sbin/wpa_supplicant . 

Editing nettree fixed the problem.

Does that help you?

Best regards,

Jimini

----------

## Heimfrost

 *Jimini wrote:*   

>  *Heimfrost wrote:*   It seems something neccessary or Path is missing before. 
> 
> Here a wrong path is mentioned (see comment #6):
> 
> I encountered a similar bug two days ago on a fully updated ~amd64 system. 
> ...

 

Thx for the link. Sounds as the same as my problem is.

The problem is, I have no baselayout2 and openrc installed and under my /sbin theres already a wpa_supplicant symlink to /usr/sbin/wpa_supplicant

I think I will try to migrate to baselayout2 (which is masked) and see if that helps.

Edit: The migration to openrc-0.6.1-r1 and baselayout 2.0.1 solved it for me WITH editing 

```
/lib64/rc/cache/nettree
```

(wpa_supplicant pointed to /sbin there and not to /usr/sbin)

The symlink of wpa_supplicant in /sbin seems not to work in this case, so I had to edit the correct path in the file above like described in your bug link.

Maybe baselayout1 has such a wrong entry somewhere too, I don't know.

----------

## gollum

Thanks! 

Editing 

```
/lib/rc/cache/nettree
```

 fixed same problem here.

----------

