[PATCH] wpa_cli infinite loop

Kel Modderman kel at otaku42.de
Wed Oct 29 04:12:44 EDT 2008


On Wednesday 29 October 2008 15:03:07 Graham Gower wrote:
> I start wpa_supplicant and wpa_cli from a script like so:
> 
>        wpa_supplicant \
>                -Bw \
>                -i $iface \
>                -D ralink \
>                -c $wpa_conf \
>                -P $wpa_pidfile
> 
>        # wait for wpa_supplicant to open its socket interface
>        while [ ! -r /var/run/wpa_supplicant/$iface ]; do
>                sleep 1
>                echo -n "."
>        done
> 
>        wpa_cli \
>                -B \
>                -a/etc/init.d/wpa_action.sh \
>                -P $wpa_cli_pidfile
> 
> 
> The wpa_supplicant.conf file contains a network and wpa_supplicant
> associates with it. Sometimes, wpa_cli will fail to call my action
> script (I am unsure what triggers this - a race?).

Have you tried using the -W (Wait for a control interface monitor before
starting.) wpa_supplicant command line option? It is needed to avoid
wpa_supplicant generating events before your action script process
is able to receive them.

Also be aware the the -w option is removed from 0.6.X.

Thanks, Kel.


More information about the HostAP mailing list