# Wireless wpa problem with conf.d/net [SOLVED]

## Snake

Hi,

I've got problems with settings in /etc/conf.d/net.

I can connect to network using these two commands in bash:

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

dhcpcd wlan0
```

But I can't connect with net.wlan0. I've searched google and gentoo forum but without luck.

Content in my net file is:

```
modules=( "wpa_supplicant"  "dhcpcd")

config=( "dhcp" )

wpa_supplicant_wlan0 -B -c/etc/wpa_supplicant/stanovanje.conf -iwlan0 -Dwext

wpa_timeout=60
```

Executing /etc/init.d/net.wlan0 gives me these errors:

```

 * Caching service dependencies ...

/etc/conf.d/net: line 18: wpa_supplicant_wlan0: command not found

/etc/conf.d/net: line 18: wpa_supplicant_wlan0: command not found

/etc/conf.d/net: line 18: wpa_supplicant_wlan0: command not found                                [ ok ]

/etc/conf.d/net: line 18: wpa_supplicant_wlan0: command not found

 * WARNING:  net.wlan0 has already been started.

```

I've also tried replacing wpa_supplicant_wlan0 in net with wpa_supplicant, but it also doesn't work:

```
 * Caching service dependencies ...                                                              [ ok ]

ctrl_iface exists and seems to be in use - cannot override it

Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore

Failed to initialize control interface '/var/run/wpa_supplicant'.

You may have another wpa_supplicant process already running or the file was

left by an unclean termination of wpa_supplicant in which case you will need

to manually remove this file before starting wpa_supplicant again.

 * WARNING:  net.wlan0 has already been started.
```

Does anyone have any idea what's wrong?Last edited by Snake on Wed Feb 02, 2011 7:55 pm; edited 1 time in total

----------

## rufnut

I have had some issues with "wpa_supplicant" as a client too.

The quick fix for me was to install "wicd" and use it.

 :Smile: 

----------

## tuber

Try this in your /etc/conf.d/net file instead:

```
modules=( "wpa_supplicant"  "dhcpcd")

config=( "dhcp" )

wpa_supplicant_wlan0="-c/etc/wpa_supplicant/stanovanje.conf -Dwext"

wpa_timeout=60
```

----------

## Snake

I've tried tuber's suggestion and it didn't help, I got the same error.

----------

## coolsnowmen

 *Snake wrote:*   

> I've tried tuber's suggestion and it didn't help, I got the same error.

 

this file is sourced, which is why when you forgot the "=" sign in the first post, you get an error, "command not found."

The latter (tuber's correction) is variable assignment; i.e with the "=" sign there, it is impossible to get the same error.  Please verify you have the correct syntax.

Also are you using baselayout-1 or baselayout-2/openrc?

----------

## vortex_3

I think there is a error in the syntax there. Try this: 

wpa_supplicant_wlan0="-Dwext -c /etc/wpa_supplicant/stanovanje.conf"

There is a white space between "-c" and "/etc/wpa_supplicant/stanovanje.conf". Also, the "-Dwext" options is placed at the beginnig although I don't know is that makes any difference.

I found that here.

Hope it helps...

----------

## Snake

I forgot about this topic a little. I've done what vortex_3 said and configuration is working  :Smile:  . Thanks for help.

----------

