[pkg-wpa-devel] r990 - in /wpasupplicant/trunk/debian: ifupdown/functions.sh ifupdown/ifupdown.sh wpasupplicant.postinst wpasupplicant.postrm wpasupplicant.preinst wpasupplicant.wpa-ifupdown.init
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Sun Jan 6 02:12:05 UTC 2008
Author: kelmo-guest
Date: Sun Jan 6 02:12:05 2008
New Revision: 990
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=990
Log:
revert r989, this is what happens when not thinking about what you do...
Added:
wpasupplicant/trunk/debian/wpasupplicant.wpa-ifupdown.init
Removed:
wpasupplicant/trunk/debian/wpasupplicant.preinst
Modified:
wpasupplicant/trunk/debian/ifupdown/functions.sh
wpasupplicant/trunk/debian/ifupdown/ifupdown.sh
wpasupplicant/trunk/debian/wpasupplicant.postinst
wpasupplicant/trunk/debian/wpasupplicant.postrm
Modified: wpasupplicant/trunk/debian/ifupdown/functions.sh
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/ifupdown/functions.sh?rev=990&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/ifupdown/functions.sh (original)
+++ wpasupplicant/trunk/debian/ifupdown/functions.sh Sun Jan 6 02:12:05 2008
@@ -32,14 +32,12 @@
WPA_SUP_BIN="/sbin/wpa_supplicant"
WPA_SUP_PNAME="wpa_supplicant"
WPA_SUP_PIDFILE="/var/run/wpa_supplicant.${WPA_IFACE}.pid"
-WPA_SUP_OMIT_PIDFILE="/lib/init/rw/sendsigs.omit.d/wpa_supplicant.${WPA_IFACE}.pid"
WPA_SUP_LOGFILE="/var/log/wpa_supplicant.${WPA_IFACE}.log"
# wpa_cli variables
WPA_CLI_BIN="/sbin/wpa_cli"
WPA_CLI_PNAME="wpa_cli"
WPA_CLI_PIDFILE="/var/run/wpa_action.${WPA_IFACE}.pid"
-WPA_CLI_OMIT_PIDFILE="/lib/init/rw/sendsigs.omit.d/wpa_action.${WPA_IFACE}.pid"
WPA_CLI_LOGFILE="/var/log/wpa_action.${WPA_IFACE}.log"
WPA_CLI_TIMESTAMP="/var/run/wpa_action.${WPA_IFACE}.timestamp"
@@ -245,17 +243,6 @@
wpa_msg stderr "$WPA_SUP_BIN daemon failed to start"
return 1
fi
-
- if [ -s "$WPA_SUP_PIDFILE" ]; then
- # add pid to sendsigs omit directory
- if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then
- cat "$WPA_SUP_PIDFILE" > "$WPA_SUP_OMIT_PIDFILE"
- else
- wpa_msg stderr "sendsigs omit dir does not exist: /lib/init/rw/sendsigs.omit.d/"
- fi
- else
- wpa_msg stderr "pidfile missing or empty: $WPA_SUP_PIDFILE"
- fi
local WPA_SOCKET_WAIT MAX_WPA_SOCKET_WAIT
WPA_SOCKET_WAIT="0"
@@ -294,11 +281,6 @@
if [ -f "$WPA_SUP_PIDFILE" ]; then
rm -f "$WPA_SUP_PIDFILE"
fi
-
- if [ -f "$WPA_SUP_OMIT_PIDFILE" ]; then
- wpa_msg verbose "removing $WPA_SUP_OMIT_PIDFILE"
- rm -f "$WPA_SUP_OMIT_PIDFILE"
- fi
elif [ -S "$WPA_CTRL_DIR/$WPA_IFACE" ]; then
wpa_msg action "terminating via ctrl_interface socket $WPA_CTRL_DIR/$WPA_IFACE"
@@ -351,16 +333,6 @@
wpa_msg stderr "$WPA_CLI_BIN daemon failed to start"
return 1
fi
-
- if [ -s "$WPA_CLI_PIDFILE" ]; then
- if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then
- cat "$WPA_CLI_PIDFILE" > "$WPA_CLI_OMIT_PIDFILE"
- else
- wpa_msg stderr "sendsigs omit dir does not exist: /lib/init/rw/sendsigs.omit.d/"
- fi
- else
- wpa_msg stderr "empty or missing: $WPA_CLI_PIDFILE"
- fi
fi
}
@@ -378,10 +350,6 @@
if [ -f "$WPA_CLI_PIDFILE" ]; then
rm -f "$WPA_CLI_PIDFILE"
- fi
-
- if [ -f "$WPA_CLI_OMIT_PIDFILE" ]; then
- rm -f "$WPA_CLI_OMIT_PIDFILE"
fi
fi
}
Modified: wpasupplicant/trunk/debian/ifupdown/ifupdown.sh
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/ifupdown/ifupdown.sh?rev=990&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/ifupdown/ifupdown.sh (original)
+++ wpasupplicant/trunk/debian/ifupdown/ifupdown.sh Sun Jan 6 02:12:05 2008
@@ -57,27 +57,9 @@
exit 0
fi
+# quit if wpa_action is active
if test_wpa_cli; then
- # wpa-roam/wpa_action mode is active
- if [ "$MODE" = stop ]; then
- RUNLEVEL=$(/sbin/runlevel)
- RUNLEVEL="${RUNLEVEL#*\ }"
- case "$RUNLEVEL" in
- 0|6)
- # wpa_cli and wpa_supplicant are to be killed, we are in
- # shutdown or reboot
- wpa_msg verbose "allowing stop, runlevel: $RUNLEVEL"
- ;;
- *)
- # allow wpa_cli daemon (wpa-roam/wpa_action) to continue,
- # we are in a standard runlevel
- exit 0
- ;;
- esac
- else
- # allow wpa_cli daemon (wpa-roam/wpa_action) to continue
- exit 0
- fi
+ exit 0
fi
# preliminary sanity checks for roaming daemon
Modified: wpasupplicant/trunk/debian/wpasupplicant.postinst
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/wpasupplicant.postinst?rev=990&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/wpasupplicant.postinst (original)
+++ wpasupplicant/trunk/debian/wpasupplicant.postinst Sun Jan 6 02:12:05 2008
@@ -15,23 +15,8 @@
# If prerm fails during replacement due to conflict:
# <postinst> abort-remove in-favour <new-package> <version>
-# Remove a no-longer used conffile
-rm_conffile() {
- CONFFILE="$1"
-
- if [ -e "$CONFFILE" ]; then
- echo "Removing obsolete conffile $CONFFILE"
- rm -f "$CONFFILE"
- fi
-}
-
case "$1" in
configure)
- # Remove the obsolete wpa-ifupdown workaround
- if dpkg --compare-versions "$2" le "0.6.2-1"; then
- rm_conffile /etc/init.d/wpa-ifupdown
- update-rc.d -f wpa-ifupdown remove || true
- fi
# Add the netdev group unless it's already there
if ! getent group netdev >/dev/null; then
addgroup --quiet --system netdev || true
Modified: wpasupplicant/trunk/debian/wpasupplicant.postrm
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/wpasupplicant.postrm?rev=990&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/wpasupplicant.postrm (original)
+++ wpasupplicant/trunk/debian/wpasupplicant.postrm Sun Jan 6 02:12:05 2008
@@ -26,18 +26,6 @@
# If preinst fails during upgrade:
# <new-postrm> abort-upgrade <old-version>
-# Undo removal of a no-longer used conffile
-undo_rm_conffile() {
- CONFFILE="$1"
-
- if [ ! -e "$CONFFILE" ]; then
- if [ -e "$CONFFILE".dpkg-bak ]; then
- echo "Restoring modified conffile $CONFFILE"
- mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
- fi
- fi
-}
-
case "$1" in
remove)
;;
@@ -49,9 +37,6 @@
upgrade|failed-upgrade|disappear)
;;
abort-install|abort-upgrade)
- if dpkg --compare-versions "$2" le "0.6.2-1"; then
- undo_rm_conffile /etc/init.d/wpa-ifupdown
- fi
;;
*)
echo "$0 called with unknown argument \`$1'" 1>&2
Added: wpasupplicant/trunk/debian/wpasupplicant.wpa-ifupdown.init
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/wpasupplicant.wpa-ifupdown.init?rev=990&op=file
==============================================================================
--- wpasupplicant/trunk/debian/wpasupplicant.wpa-ifupdown.init (added)
+++ wpasupplicant/trunk/debian/wpasupplicant.wpa-ifupdown.init Sun Jan 6 02:12:05 2008
@@ -1,0 +1,69 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: wpa-ifupdown
+# Required-Start: $network
+# Required-Stop: $network
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Stop wpa_supplicant processes started via ifupdown
+# Description: Run ifdown on interfaces authenticated via
+# wpa_supplicant. Sendsigs terminates wpa_supplicant
+# processes before networking is stopped causing each
+# network interface authenticated via a wpa_supplicant
+# daemon to be terminated abrubtly.
+### END INIT INFO
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
+test -d /var/run || exit 0
+
+test -x /sbin/ifdown || exit 0
+
+. /lib/lsb/init-functions
+
+stop_wpa_action () {
+ test -x /sbin/wpa_action || return 0
+ IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_action.*.pid' -printf '%P\n' | \
+ cut -d'.' -f2 2>/dev/null)
+ if test -n "$IFACES"; then
+ log_daemon_msg "Stopping wpa_action roaming interfaces"
+ for iface in $IFACES; do
+ log_progress_msg "$iface"
+ # wpa_action executes /sbin/ifdown
+ wpa_action "$iface" stop >/dev/null 2>&1
+ done
+ log_end_msg 0
+ fi
+}
+
+stop_wpa_supplicant () {
+ IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_supplicant.*.pid' -printf '%P\n' | \
+ grep -v wpa_supplicant.dbus.pid | cut -d'.' -f2 2>/dev/null)
+ if test -n "$IFACES"; then
+ log_daemon_msg "Stopping wpa_supplicant interfaces"
+ for iface in $IFACES; do
+ log_progress_msg "$iface"
+ ifdown "$iface" >/dev/null 2>&1
+ done
+ log_end_msg 0
+ fi
+}
+
+case "$1" in
+ start|restart|force-reload)
+ # No-op
+ ;;
+ stop)
+ stop_wpa_action
+ stop_wpa_supplicant
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+exit 0
More information about the Pkg-wpa-devel
mailing list