# Failed to connect to wpa_supplicant - wpa_ctrl_open [solved]

## samo

Hello,

wpa_supplicant 0.7.3-r5 was re-emerged during world update. I don't know why. But after that I get the following error during startup:

```
 * Setting system clock using the hardware clock [UTC] ...

 [ ok ]

 * Autoloaded 0 module(s)

 * Checking local filesystems  ...

Reiserfs super block in block 16 on 0x803 of format 3.6 with standard journal

Blocks (total/free): 5243200/1662751 by 4096 bytes

Filesystem is clean

samsung_1_/boot: sauber, 66/12048 Dateien, 18503/48160 Blöcke

 [ ok ]

 * Remounting root filesystem read/write ...

 [ ok ]

 * Updating /etc/mtab ...

 [ ok ]

 * Mounting local filesystems ...

 [ ok ]

 * Configuring kernel parameters ...

 [ ok ]

 * Creating user login records ...

 [ ok ]

 * Cleaning /var/run ...

 [ ok ]

 * Wiping /tmp directory ...

 [ ok ]

 * Restoring Mixer Levels ...

 [ ok ]

 * Setting hostname to gentoo ...

 [ ok ]

 * Setting terminal encoding [UTF-8] ...

 [ ok ]

 * Setting keyboard mode [UTF-8] ...

 [ ok ]

 * Loading key mappings [de-latin1-nodeadkeys] ...

 [ ok ]

 * Bringing up interface lo

 *   127.0.0.1/8 ...

 [ ok ]

 *   Adding routes

 *     127.0.0.0/8 via 127.0.0.1 ...

 [ ok ]

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

wpa_supplicant v0.7.3

Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it

under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the

BSD license. See README and COPYING for more details.

This product includes software developed by the OpenSSL Project

for use in the OpenSSL Toolkit (http://www.openssl.org/)

usage:

  wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] [-g<global ctrl>] \

        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \

        [-b<br_ifname>] [-f<debug file>] \

        [-o<override driver>] [-O<override ctrl>] \

        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \

        [-p<driver_param>] [-b<br_ifname>] ...]

drivers:

  wext = Linux wireless extensions (generic)

  nl80211 = Linux nl80211/cfg80211

  hostap = Host AP driver (Intersil Prism2/2.5/3)

  atmel = ATMEL AT76C5XXx (USB, PCMCIA)

  ndiswrapper = Linux ndiswrapper (deprecated; use wext)

  ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer)

  wired = Wired Ethernet driver

  ralink = Ralink Wireless Client driver

options:

  -b = optional bridge interface name

  -B = run daemon in the background

  -c = Configuration file

  -C = ctrl_interface parameter (only used if -c is not)

  -i = interface name

  -d = increase debugging verbosity (-dd even more)

  -D = driver name (can be multiple drivers: nl80211,wext)

  -g = global ctrl_interface

  -K = include keys (passwords, etc.) in debug output

  -t = include timestamp in debug messages

  -h = show this help text

  -L = show license (GPL and BSD)

  -o = override driver parameter for new interfaces

  -O = override ctrl_interface parameter for new interfaces

  -p = driver parameters

  -P = PID file

  -q = decrease debugging verbosity (-qq even less)

  -u = enable DBus control interface

  -v = show version

  -W = wait for a control interface monitor before starting

  -N = start describing new interface

example:

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

 [ ok ]

 *   Starting wpa_cli on wlan0 ...

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

 *   start-stop-daemon: failed to start `/usr/bin/wpa_cli'

 [ !! ]

 * ERROR: net.wlan0 failed to start

 * Activating swap devices ...

 [ ok ]

 * Initializing random number generator ...

 [ ok ]

 * Starting D-BUS system messagebus ...

 [ ok ]

 * Starting syslog-ng ...

 [ ok ]

 * Starting ConsoleKit daemon ...

 [ ok ]

 * Setting console font [lat9w-16] ...

 [ ok ]

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

wpa_supplicant v0.7.3

Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it

under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the

BSD license. See README and COPYING for more details.

This product includes software developed by the OpenSSL Project

for use in the OpenSSL Toolkit (http://www.openssl.org/)

usage:

  wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] [-g<global ctrl>] \

        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \

        [-b<br_ifname>] [-f<debug file>] \

        [-o<override driver>] [-O<override ctrl>] \

        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \

        [-p<driver_param>] [-b<br_ifname>] ...]

drivers:

  wext = Linux wireless extensions (generic)

  nl80211 = Linux nl80211/cfg80211

  hostap = Host AP driver (Intersil Prism2/2.5/3)

  atmel = ATMEL AT76C5XXx (USB, PCMCIA)

  ndiswrapper = Linux ndiswrapper (deprecated; use wext)

  ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer)

  wired = Wired Ethernet driver

  ralink = Ralink Wireless Client driver

options:

  -b = optional bridge interface name

  -B = run daemon in the background

  -c = Configuration file

  -C = ctrl_interface parameter (only used if -c is not)

  -i = interface name

  -d = increase debugging verbosity (-dd even more)

  -D = driver name (can be multiple drivers: nl80211,wext)

  -g = global ctrl_interface

  -K = include keys (passwords, etc.) in debug output

  -t = include timestamp in debug messages

  -h = show this help text

  -L = show license (GPL and BSD)

  -o = override driver parameter for new interfaces

  -O = override ctrl_interface parameter for new interfaces

  -p = driver parameters

  -P = PID file

  -q = decrease debugging verbosity (-qq even less)

  -u = enable DBus control interface

  -v = show version

  -W = wait for a control interface monitor before starting

  -N = start describing new interface

example:

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

 [ ok ]

 *   Starting wpa_cli on wlan0 ...

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

 *   start-stop-daemon: failed to start `/usr/bin/wpa_cli'

 [ !! ]

 * ERROR: net.wlan0 failed to start

 * Mounting network filesystems ...

 [ ok ]

 * Setting up kdm ...

 [ ok ]

 * Starting mysql ...

 [ ok ]

 * Starting apache2 ...

 [ ok ]

 * Starting cupsd ...

 [ ok ]

 * Starting MythTV Backend ...

 * WARNING: -c/--chuid is deprecated and will be removed in the future, please use -u/--user instead

 [ ok ]

 * Starting pcscd ...

 [ ok ]

 * Doing udev cleanups

 * Starting vixie-cron ...

 [ ok ]

 * Starting xinetd ...

 [ ok ]

 * Starting local

 [ ok ]

```

Running /etc/init.d/net.wlan0 manually shows the same error.

But running wpa_supplicant first /etc/init.d/net.wlan0 works:

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

[1] 3634

Trying to associate with 00:1c:4a:4f:9e:f9 (SSID='gentoo' freq=2412 MHz)

Associated with 00:1c:4a:4f:9e:f9

WPA: Key negotiation completed with 00:1c:4a:4f:9e:f9 [PTK=CCMP GTK=CCMP]

CTRL-EVENT-CONNECTED - Connection to 00:1c:4a:4f:9e:f9 completed (auth) [id=0 id_str=]
```

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

 * Bringing up interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

CTRL-EVENT-DISCONNECTED bssid=00:1c:4a:4f:9e:f9 reason=0

wpa_supplicant v0.7.3

Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it

under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the

BSD license. See README and COPYING for more details.

This product includes software developed by the OpenSSL Project

for use in the OpenSSL Toolkit (http://www.openssl.org/)

usage:

  wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] [-g<global ctrl>] \

        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \

        [-b<br_ifname>] [-f<debug file>] \

        [-o<override driver>] [-O<override ctrl>] \

        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \

        [-p<driver_param>] [-b<br_ifname>] ...]

drivers:

  wext = Linux wireless extensions (generic)

  nl80211 = Linux nl80211/cfg80211

  hostap = Host AP driver (Intersil Prism2/2.5/3)

  atmel = ATMEL AT76C5XXx (USB, PCMCIA)

  ndiswrapper = Linux ndiswrapper (deprecated; use wext)

  ipw = Intel ipw2100/2200 driver (old; use wext with Linux 2.6.13 or newer)                                        

  wired = Wired Ethernet driver                                                                                     

  ralink = Ralink Wireless Client driver                                                                            

options:

  -b = optional bridge interface name

  -B = run daemon in the background

  -c = Configuration file

  -C = ctrl_interface parameter (only used if -c is not)

  -i = interface name

  -d = increase debugging verbosity (-dd even more)

  -D = driver name (can be multiple drivers: nl80211,wext)

  -g = global ctrl_interface

  -K = include keys (passwords, etc.) in debug output

  -t = include timestamp in debug messages

  -h = show this help text

  -L = show license (GPL and BSD)

  -o = override driver parameter for new interfaces

  -O = override ctrl_interface parameter for new interfaces

  -p = driver parameters

  -P = PID file

  -q = decrease debugging verbosity (-qq even less)

  -u = enable DBus control interface

  -v = show version

  -W = wait for a control interface monitor before starting

  -N = start describing new interface

example:

  wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf                                     [ ok ]

 *   Starting wpa_cli on wlan0 ...                                                             [ ok ]

 *   Backgrounding ... ...

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

/etc/conf.d/net looks like this:

```
modules_wlan0="!plug wpa_supplicant"

wpa_supplicant_wlan0="-Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf -f /var/log/wpa_supplicant.log -dd"

wpa_timeout_wlan0=15

config_gentoo="192.168.178.22/24"

dns_servers_gentoo="208.67.222.222"
```

And /etc/wpa_supplicant/wpa_supplicant.conf like this:

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

fast_reauth=1

network={

        ssid="gentoo"

        scan_ssid=1

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP

        group=CCMP

        psk="password"

        priority=5

}
```

Does someone has an idea how to solve the problem?

RegardsLast edited by samo on Sun Aug 12, 2012 1:17 pm; edited 1 time in total

----------

## khayyam

samo ...

It looks as though the debug useflag is not set for net-wireless/wpa_supplicant ... in order to use '-f /var/log/wpa_supplicant.log -dd' you need +debug, this is why it works from the command line, these options are ommited.

/etc/portage/package.use

```
net-wireless/wpa_supplicant debug
```

best ... khay

----------

## samo

Thanks for the tip. Now it works again.

----------

## khayyam

 *samo wrote:*   

> Thanks for the tip. Now it works again.

 

samo ... ok, good, you should now mark this thread as "[SOLVED]" (edit: OK, I see you already have)

BTW, for normal everyday use '-f /var/log/wpa_supplicant.log -qq' would be a better, -dd being verbose, and -qq being the lowest debug level. This way the logs are kept at a minimum, and -dd can be reapplied if you need debug output.

best ... khay

----------

## samo

I need verbose debug output because I still have some problem with my wireless connection.

----------

