# [solved]wpa_supplicant crashed

## EugeneTheJeep

Hi,

My wpa_supplicant daemon appears to be crashing. It doesn't affect my network connection at all, but it's annoying and I'm concerned it might be a security issue.

Here is my rc-status, /etc/wpa_supplicant/wpa_supplicant.conf, and /etc/conf.d/wpa_supplicant

```

$ sudo rc-status

Password: 

Runlevel: default

 sysklogd                                                                  [  started  ]

 cronie                                                                    [  started  ]

 wpa_supplicant                                                            [  crashed  ]

 net.wlan0                                                                 [  started  ]

 cupsd                                                                     [  started  ]

 netmount                                                                  [  started  ]

 local                                                                     [  started  ]

Dynamic Runlevel: hotplugged

Dynamic Runlevel: needed/wanted

 dbus                                                                      [  started  ]

 modules-load                                                              [  started  ]

Dynamic Runlevel: manual

```

```

cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

update_config=1

network={

        ssid="xxxxxxxxxxxxxx"

        scan_ssid=1

        bssid=XX:XX:XX:XX:XX:XX

        psk="xxxxxxxx"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP

        auth_alg=OPEN

        priority=5

}

```

```

# conf.d file for wpa_supplicant

#

# Please check man 8 wpa_supplicant for more information about the options

# wpa_supplicant accepts.

#

wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_supplicant.conf"

```

Just wondering if anyone knew why it might be crashing and if there is a fix for it. ThanksLast edited by EugeneTheJeep on Sat Jun 03, 2017 4:24 pm; edited 1 time in total

----------

## Telemin

[EDIT2] Nevermind, I got ahead of myself. See posts below.

Well, your config looks okay, a bit overspecified perhaps, but nothing incorrect about it.

I suggest you try running it in the foreground and see what happens, it may give you an enlightening error message when it quits.

[EDIT] - of course you can also use logging.  try adding "-dd -f /var/log/wpa_supplicant.log" to wpa_supplicant_args in /etc/conf.d/wpa_supplicant and see if there is any enlightening information given

Beyond that, you are looking at needing to build with debug symbols and attach gdb to see what is going on.

-Telemin-

----------

## Jaglover

Why is it configured to run by itself? Normally the wpa_supplicant is started by some network management application.

----------

## Telemin

 *Jaglover wrote:*   

> Why is it configured to run by itself? Normally the wpa_supplicant is started by some network management application.

 

Right, that would be it.  Two instances are trying to start.  First the /etc/init.d/net.wlan0 script starts an instance, and then the instance from the /etc/init.d/wpa_supplicant, but that can't bind to the interface because there is already an instance bound so it quits with an error.

Just rc-update del wpa_supplicant  :Smile: 

FYI You can either use the net.* scripts to configure your networks, or start wpa_supplicant and dhcpcd manually.  If you try to do both like this they conflict.

-Telemin-

----------

## EugeneTheJeep

Telemin,

Thanks, it worked. I guess this means I can delete wpa_supplicant from /etc/init.d? Or is that needed by net.wlan0?

----------

## Telemin

You don't ever need to delete things from /etc/init.d, that is just where the init scripts get installed to when you emerge a package.  The actual place that openrc finds the information on what to run at boot is the /etc/runlevels directory.  If you look in there you will see symlinks corresponding to all the services you have enabled.  rc-update is just a little helper script that manages these symlinks for you, now you have removed the wpa_supplicant service from the default runlevel everything is as it should be.  If you did delete the init script portage would just put it back the next time wpa-supplicant is emerged anyhow.

-Telemin-

----------

## EugeneTheJeep

Got it. Thanks. Marking solved.

----------

## UberLord

 *Jaglover wrote:*   

> Why is it configured to run by itself? Normally the wpa_supplicant is started by some network management application.

 

That's not a blanket rule though.

By allowing wpa_supplicant to manage things itself (which later versions can do via the match interface directive) then the network management application doesn't need to know how the physical link should be brought up

This in turn allows the possibility of swapping wpa_supplicant out with another variant as one would with an address auto-configuration client such as dhcpcd.

----------

