summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-06-11 22:33:39 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-06-11 22:33:58 +0200
commitad711a91917752a887cf99f61e8c23986358671f (patch)
treec9b03b4b9f2c516970fd4e8dcc60afdf554e994e
parentb000b55ddc7fad62cd5a0cc2877648e54ee40268 (diff)
downloadnetctl-ad711a91917752a887cf99f61e8c23986358671f.tar.gz
netctl-ad711a91917752a887cf99f61e8c23986358671f.tar.xz
Move wpa_supplicant PID file to /run
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
-rw-r--r--NEWS2
-rw-r--r--src-wireless/wireless-dbus6
-rw-r--r--src/8021x10
-rw-r--r--src/wireless4
4 files changed, 11 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 73ec79e..b9257da 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ version 2.6
- add support for creating tun/tap interfaces (FS#15049)
- wireless: add support for explicit BSSID (FS#24582)
- wireless: add support for ad-hoc connections (FS#19683)
-- does not install things in /var/run
+- use /run instead of /var/run
- drops dependency on net-tools package
version 2.5.5
diff --git a/src-wireless/wireless-dbus b/src-wireless/wireless-dbus
index 459e2fd..0e219b6 100644
--- a/src-wireless/wireless-dbus
+++ b/src-wireless/wireless-dbus
@@ -53,7 +53,7 @@ def fail(msg=None, report_type="fail"):
if msg:
report(report_type, msg)
try:
- pid = open("/var/run/wpa_supplicant.pid").read()
+ pid = open("/run/wpa_supplicant.pid").read()
except IOError:
pass
else:
@@ -75,7 +75,7 @@ def start(profile, essid):
# subprocess.call(["iwconfig", profile['INTERFACE'], profile['IWCONFIG']])
# Base arguments
- args=["wpa_supplicant", "-Bu", "-P/var/run/wpa_supplicant.pid"]
+ args=["wpa_supplicant", "-Bu", "-P/run/wpa_supplicant.pid"]
try:
args.append(profile['WPA_OPTS'])
@@ -187,7 +187,7 @@ def start(profile, essid):
def stop(profile):
ret = subprocess.call([ETHERNET_IPROUTE, "down", sys.argv[2]])
- os.kill(int(open("/var/run/wpa_supplicant.pid").read()),SIGTERM)
+ os.kill(int(open("/run/wpa_supplicant.pid").read()),SIGTERM)
sys.exit(ret)
if __name__ == "__main__":
diff --git a/src/8021x b/src/8021x
index 2c49334..53c02de 100644
--- a/src/8021x
+++ b/src/8021x
@@ -30,10 +30,10 @@ start_wpa()
shift 3
local WPA_OPTS="$*"
- wpa_supplicant -B -P "/var/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE" -D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS
+ wpa_supplicant -B -P "/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE" -D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS
sleep 1
- if [[ ! -f "/var/run/wpa_supplicant_${INTERFACE}.pid" ]]; then
+ if [[ ! -f "/run/wpa_supplicant_${INTERFACE}.pid" ]]; then
return 1
fi
}
@@ -43,8 +43,8 @@ stop_wpa()
wpa_cli -i "$1" terminate &> /dev/null
sleep 1 # JP: need this else the file tends to disappear after [[ -f ... ]] but before cat...
# see <http://bbs.archlinux.org/viewtopic.php?pid=515667#p515667>
- if [[ -f "/var/run/wpa_supplicant_$1.pid" ]]; then
- kill "$(cat "/var/run/wpa_supplicant_$1.pid")" &>/dev/null &
+ if [[ -f "/run/wpa_supplicant_$1.pid" ]]; then
+ kill "$(cat "/run/wpa_supplicant_$1.pid")" &>/dev/null &
fi
}
@@ -56,7 +56,7 @@ make_wpa_config_file() {
# make empty tmp dir with correct permissions, rename it
rm -rf "$WPA_CONF"
mv -f "$(mktemp -d)" "$WPA_CONF" || return 1
- echo "ctrl_interface=/var/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted
+ echo "ctrl_interface=/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted
echo "ctrl_interface_group=${WPA_GROUP:-wheel}" >> "$WPA_CONF/wpa.conf"
[[ $WPA_COUNTRY ]] && echo "country=$WPA_COUNTRY" >> "$WPA_CONF/wpa.conf"
[[ -n "$ADHOC" ]] && echo "ap_scan=2" >> "$WPA_CONF/wpa.conf"
diff --git a/src/wireless b/src/wireless
index 22b84a9..8a75d68 100644
--- a/src/wireless
+++ b/src/wireless
@@ -86,7 +86,7 @@ wpa_supplicant_scan_info() {
[[ -z "$INTERFACE" ]] && return 1
essids=$(mktemp --tmpdir essid.XXXXXXXX)
- wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/var/run/wpa_supplicant -P/var/run/wpa_supplicant.pid || return 1
+ wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/run/wpa_supplicant -P/run/wpa_supplicant.pid || return 1
wpa_cli -i "$INTERFACE" scan &> /dev/null
sleep 2.5
wpa_cli -i "$INTERFACE" scan_results |
@@ -104,7 +104,7 @@ wpa_supplicant_scan_info() {
# Re-sort by strength as the removal disorders the list
# Cut to the AP/essid fields only
- kill "$(cat /var/run/wpa_supplicant.pid)"
+ kill "$(cat /run/wpa_supplicant.pid)"
# File of 0 length, ie. no ssid's.
if [[ ! -s "$essids" ]]; then