Changeset 13078


Ignore:
Timestamp:
2008-10-29T18:26:49+01:00 (8 years ago)
Author:
nbd
Message:

use pidfiles for hostapd/wpa_supplicant instead of killing all processes when bringing an interface down - fixes an issue with random hostapd death

Location:
trunk/package
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/sbin/wifi

    r13026 r13078  
    8585        local vifs vif vifstr 
    8686 
     87        [ -f "/var/run/wifi-${cfg}.pid" ] && 
     88                kill "$(cat "/var/run/wifi-${cfg}.pid")" 
    8789        uci_revert_state wireless "$cfg" 
    8890        config_get vifs "$cfg" vifs 
  • trunk/package/hostapd/files/hostapd.sh

    r13076 r13078  
    9797$hostapd_cfg 
    9898EOF 
    99         hostapd -B /var/run/hostapd-$ifname.conf 
     99        hostapd -P /var/run/wifi-$ifname.conf -B /var/run/hostapd-$ifname.conf 
    100100} 
    101101 
  • trunk/package/madwifi/files/lib/wifi/madwifi.sh

    r13039 r13078  
    5151 
    5252        set_wifi_down "$device" 
    53         # kill all running hostapd and wpa_supplicant processes that 
    54         # are running on atheros vifs  
    55         for pid in `pidof hostapd wpa_supplicant`; do 
    56                 grep ath /proc/$pid/cmdline >/dev/null && \ 
    57                         kill $pid 
    58         done 
    5953         
    6054        include /lib/network 
     
    6256        for dev in *; do 
    6357                grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && { 
    64                         ifconfig "$dev" down  
     58                        [ -f "/var/run/wifi-${dev}.pid" ] && 
     59                                kill "$(cat "/var/run/wifi-${dev}.pid")" 
     60                        ifconfig "$dev" down 
    6561                        unbridge "$dev" 
    6662                        wlanconfig "$dev" destroy 
  • trunk/package/wpa_supplicant/files/wpa_supplicant.sh

    r12292 r13078  
    7676} 
    7777EOF 
    78         [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf 
     78        [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf 
    7979} 
Note: See TracChangeset for help on using the changeset viewer.