Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75196 - wpa_supplicant helper script should remove ctrl_interface directory upon startup
Summary: wpa_supplicant helper script should remove ctrl_interface directory upon startup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 66472
  Show dependency tree
 
Reported: 2004-12-21 09:03 UTC by Jos Delbar
Modified: 2005-01-31 00:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patches /lib/rcscripts/net.modules.d/wpa_supplicant. (netpatch.diff,564 bytes, patch)
2004-12-21 09:06 UTC, Jos Delbar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jos Delbar 2004-12-21 09:03:07 UTC
If an instance of wpa_supplicant was terminated uncleanly, for example due to a system crash, the wpa_supplicant helper script in baselayout-1.11.8 is unable to restart the service. Wpa_supplicant will complain about a leftover directory, which is by default /var/run/wpa_supplicant/.

The attached patch will query the user's /etc/wpa_supplicant.conf file for the ctrl_interface variable and remove the matching directory if it still exists.

Reproducible: Always
Steps to Reproduce:
1. Start a net script that uses the wpa_supplicant module.
2. SIGKILL wpa_supplicant.
3. Restart the net script.
Comment 1 Jos Delbar 2004-12-21 09:06:02 UTC
Created attachment 46549 [details, diff]
Patches /lib/rcscripts/net.modules.d/wpa_supplicant.

Patches /lib/rcscripts/net.modules.d/wpa_supplicant.
Comment 2 Henrik Brix Andersen 2005-01-12 03:04:27 UTC
Perhaps adding a patch for wpa_supplicant which allows removing the ctrl interface directory before attempting to bind the socket (via command line option) would be a better solution in the long run.

I'll look into this.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-01-13 07:00:47 UTC
Fixed in CVS - will be in baselayout-1.11.9
Comment 4 Jouni Malinen 2005-01-29 10:33:01 UTC
ctrl_iface directory should only be removed in case the system is restarted. There may be more than one wpa_supplicant process using the same directory. In general, the ctrl_iface file is blocking two wpa_supplicant processed for the same interface and this functionality should be maintained since it can avoid some very odd looking results if more than one process is controlling the same interface..

I changed wpa_supplicant to test whether the existing socket accepts connections and if it does not, to replace it with a new one. This allows wpa_supplicant to recover from forced termination (e.g., SIGKILL or crash) and as such, make the attached patch unnecessary. This change is now in CVS and will be included in the next 0.3.x release.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2005-01-30 06:53:26 UTC
That's good :)

The patch above is not what made it into our wpa_supplicant helper - first we kill any wpa_supplicant process running on the interface and then we clear the stale socket. So this shouldn't matter ....

Anyway, I'll remove the patch when the oldest wpa_supplicant ebuild in portage has your new functionality.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-01-31 00:01:14 UTC
Fixed by baselayout-1.11.9