Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 206621 - wpa_supplicant 0.6.1 and wpa_supplicant.sh timing out because of -W option
Summary: wpa_supplicant 0.6.1 and wpa_supplicant.sh timing out because of -W option
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet:wpa_supplicant
Keywords:
Depends on:
Blocks: 295613
  Show dependency tree
 
Reported: 2008-01-19 11:04 UTC by Dominik Behr
Modified: 2011-03-30 09:03 UTC (History)
3 users (show)

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


Attachments
Initscript proof-of-concept / work-around. (net.ra0,806 bytes, text/plain)
2008-12-18 17:48 UTC, Boney McCracker
Details
Action script proof-of-concept / work-around (wpa_action.sh,608 bytes, text/plain)
2008-12-18 17:51 UTC, Boney McCracker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Behr 2008-01-19 11:04:01 UTC
it looks like beginning from 0.6.1 version wpa_supplicant really waits for control interface monitor when -W option is specified on command line and does not respond to status requestes from wpa_cli.

unfortunately -W option is hardcoded in the script even though it should be only used when actfiles are used - see below
/lib/rcscripts/net/wpa_supplicant.sh line 311
        [[ -n ${actfile} ]] && opts="${opts} -W"

        eval start-stop-daemon --start --exec /sbin/wpa_supplicant \
                --pidfile "/var/run/wpa_supplicant-${iface}.pid" \
                -- "${opts}" -W -B -i"${iface}" \
                -P"/var/run/wpa_supplicant-${iface}.pid"
        eend "$?" || return 1

        # Starting wpa_supplication-0.4.0, we can get wpa_cli to 
        # start/stop our scripts from wpa_supplicant messages 
        if [[ -n ${actfile} ]] ; then
                mark_service_inactive "net.${iface}"
                ebegin "Starting wpa_cli on ${iface}"
                start-stop-daemon --start --exec /bin/wpa_cli \
                        --pidfile "/var/run/wpa_cli-${iface}.pid" \
                        -- -a"${actfile}" -p"${ctrl_dir}" -i"${iface}" \
                        -P"/var/run/wpa_cli-${iface}.pid" -B
                eend "$?" || return 1
        fi

-W option is meant to be used when the script means to open an instance of wpa_cli for monitoring the wpa_supplicant, but there is another unnecessary -W option hardcoded in invocation of wpa_supplicant.
Comment 1 Gabriel Devenyi 2008-02-28 19:55:22 UTC
You may want to try openrc from http://roy.marples.name/openrc he was the baselayout maintainer until he quit gentoo, this is the continuation of his baselayout-2 package with some cross platform abstractions, works fine for me. A quick check of his code indicates that he hasn't hard coded this option anymore.
Comment 2 George Kibardin 2008-07-19 19:06:24 UTC
Options -w and -W are different. -w is for waiting for interface to be on. And it is good idea to use it by default. I suspect that hardcoded -W has been initially supposed to be -w.
Comment 3 Olivier Crete (RETIRED) gentoo-dev 2008-11-01 19:00:45 UTC
The current stable script doesn't work. If we replace the hardcoded "-W" with "-w". Can we get that out ASAP, otherwise it just doesn't work.
Comment 4 Boney McCracker 2008-12-18 17:48:05 UTC
Created attachment 175763 [details]
Initscript proof-of-concept / work-around.
Comment 5 Boney McCracker 2008-12-18 17:51:20 UTC
Created attachment 175765 [details]
Action script proof-of-concept / work-around

Corresponds to Initscript.  As noted, this wpa action script serves a different purpose than the one in the Gentoo scripts (it starts/stops dhcp, instead of performing cleanup), but that doesn't matter.  The "proof of concept" here is that wpa_supplicant *can* be called with the -W option and an action script.

Those two scripts work on my system and are currently serving as a work-around.
Comment 6 Boney McCracker 2008-12-18 17:56:48 UTC
Comment on attachment 175763 [details]
Initscript proof-of-concept / work-around.

The problem seems to be that the wpa action script is being called before the control interface is established.  When I write my own initscript and action script, this doesn't happen.

I use the action script for a different purpose (to start/stop dhcp), but that shouldn't matter.  This should at least serve as a proof-of-concept that the applications are performing as they should and the problem lies within the scripts.  And it may also help somebody else as a temporary work-around (it's all hard-coded, so be careful).
Comment 7 Boney McCracker 2008-12-18 17:59:12 UTC
Oh, and I *am* using openrc, so that's not the solution.  (To subscribers, sorry for the multiple messages all at once on this.)

Comment 8 William Hubbs gentoo-dev 2011-02-20 05:44:58 UTC
What is the latest on this bug?

Thanks,

William

Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-03-30 09:03:34 UTC
No response from user for 1 month since update requested, and more than 2 years before that.
Please reopen if it's still broken.