[pkg-wpa-devel] Bug#835648: wpasupplicant: suspend takes very long due to problematic system-sleep hook

Alban Browaeys prahal at yahoo.com
Thu Nov 24 15:18:51 UTC 2016


Package: wpasupplicant
Version: 2.5-2+v2.4-3+b1
Followup-For: Bug #835648

Adding :
"
RuntimeDirectory=wpa_supplicant
RuntimeDirectoryMode=0750
"
to the [Service] section of wpa_supplicant.service file
fixed it for me.

The rationale behind this change is that I observed on resume
/run/wpa_supplicant is there but deleted soon afterwards.
This by mean of "ls -l /run".
I hastily checked tmpfiles.d for tmpclean but got not further. The
above change was suggested by tmpfiles.d man page.

Alban

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-rc5prahal+ (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages wpasupplicant depends on:
ii  adduser           3.115
ii  libc6             2.24-5
ii  libdbus-1-3       1.11.6-1
ii  libnl-3-200       3.2.27-1
ii  libnl-genl-3-200  3.2.27-1
ii  libpcsclite1      1.8.18-1
ii  libreadline7      7.0-1
ii  libssl1.0.2       1.0.2j-4
ii  lsb-base          9.20161101

wpasupplicant recommends no packages.

Versions of packages wpasupplicant suggests:
pn  libengine-pkcs11-openssl  <none>
pn  wpagui                    <none>

-- Configuration Files:
/etc/wpa_supplicant/ifupdown.sh changed:
set -x
if [ -n "$IF_WPA_MAINT_DEBUG" ]; then
	set -x
fi
if [ "$IFACE" = lo ]; then
	exit 0
fi
if [ -n "$IF_WPA_IFACE" ]; then
	WPA_IFACE="$IF_WPA_IFACE"
else
	WPA_IFACE="$IFACE"
fi
if [ -f /etc/wpa_supplicant/functions.sh ]; then
	. /etc/wpa_supplicant/functions.sh
else
	exit 0
fi
if [ ! -x "$WPA_SUP_BIN" ] || [ ! -x "$WPA_CLI_BIN" ]; then
	exit 0
fi
do_start () {
	if test_wpa_cli; then
		# if wpa_action is active for this IFACE, do nothing
		ifupdown_locked && exit 0
		# if the administrator is calling ifup, say something useful
		if [ "$PHASE" = "pre-up" ]; then
			wpa_msg stderr "wpa_action is managing ifup/ifdown state of $WPA_IFACE"
			wpa_msg stderr "execute \`ifdown --force $WPA_IFACE' to stop wpa_action"
		fi
		exit 1
	elif ! set | grep -q "^IF_WPA"; then
		# no wpa- option defined for IFACE, do nothing
		exit 0
	fi
	# ensure stale ifupdown_lock marker is purged
	ifupdown_unlock
	# preliminary sanity checks for roaming daemon
	if [ -n "$IF_WPA_ROAM" ]; then
		if [ "$METHOD" != "manual" ]; then
			wpa_msg stderr "wpa-roam can only be used with the \"manual\" inet METHOD"
			exit 1
		fi
		if [ -n "$IF_WPA_MAPPING_SCRIPT" ]; then
			if ! type "$IF_WPA_MAPPING_SCRIPT" >/dev/null; then
				wpa_msg stderr "wpa-mapping-script \"$IF_WPA_MAPPING_SCRIPT\" is not valid"
				exit 1
			fi
		fi
		if [ -n "$IF_WPA_MAPPING_SCRIPT_PRIORITY" ] && [ -z "$IF_WPA_MAPPING_SCRIPT" ]; then
			wpa_msg stderr "\"wpa-mapping-script-priority 1\" is invalid without a wpa-mapping-script"
			exit 1
		fi
		IF_WPA_CONF="$IF_WPA_ROAM"
		WPA_ACTION_SCRIPT="/sbin/wpa_action"
	fi
	# master function; determines if ifupdown.sh should do something or not
	if [ -n "$IF_WPA_CONF" ] && [ "$IF_WPA_CONF" != "managed" ]; then
		if [ ! -s "$IF_WPA_CONF" ]; then
			wpa_msg stderr "cannot read contents of $IF_WPA_CONF"
			exit 1
		fi	
		WPA_SUP_CONF_CTRL_DIR=$(sed -n -e 's/[[:space:]]*#.*//g' -e 's/[[:space:]]\+.*$//g' \
			-e 's/^ctrl_interface=\(DIR=\)\?\(.*\)/\2/p' "$IF_WPA_CONF")
		if [ -n "$WPA_SUP_CONF_CTRL_DIR" ]; then
			WPA_CTRL_DIR="$WPA_SUP_CONF_CTRL_DIR"
			WPA_SUP_CONF="-c $IF_WPA_CONF"
		else
			# specify the default ctrl_interface since none was defined in
			# the given IF_WPA_CONF
			WPA_SUP_CONF="-c $IF_WPA_CONF -C $WPA_CTRL_DIR"
		fi
	else
		# specify the default ctrl_interface
		WPA_SUP_CONF="-C $WPA_CTRL_DIR"
	fi
}
do_stop () {
	if test_wpa_cli; then
		# if wpa_action is active for this IFACE and calling ifdown,
		# do nothing
		ifupdown_locked && exit 0
	elif test_wpa_supplicant; then
		# wpa_supplicant process exists for this IFACE, but wpa_cli
		# process does not. Allow stop mode to kill this process.
		:
	else
		exit 0
	fi
}
case "$MODE" in 
	start)
		do_start
		case "$PHASE" in
			pre-up)
				kill_wpa_supplicant
				init_wpa_supplicant	|| exit 1
				conf_wpa_supplicant 	|| { kill_wpa_supplicant; exit 1; }
				;;
			post-up)
				init_wpa_cli 		|| { kill_wpa_supplicant; exit 1; }
				;;
		esac
		;;
	stop)
		do_stop
		case "$PHASE" in
			pre-down)
				kill_wpa_cli
				;;
			post-down)
				kill_wpa_supplicant
				;;
			*)
				wpa_msg stderr "unknown phase: \"$PHASE\""
				exit 1
				;;
		esac
		;;
	
	*)
		wpa_msg stderr "unknown mode: \"$MODE\""
		exit 1
		;;
esac
exit 0


-- no debconf information

-- debsums errors found:
debsums: changed file /lib/systemd/system/wpa_supplicant.service (from wpasupplicant package)



More information about the Pkg-wpa-devel mailing list