Bug#416234: [pkg-wpa-devel] Bug#416234: wpasupplicant: wpa-ifupdown
init script starts, but should stop, on runlevels 0 and 6
Kel Modderman
kel at otaku42.de
Mon Mar 26 23:27:38 CET 2007
Hi Brian,
On Monday 26 March 2007 15:15, Brian Cox wrote:
> Package: wpasupplicant
> Version: 0.5.5-4
> Severity: normal
>
>
> This package's init script, /etc/init.d/wpa-ifupdown, is configured to
> start rather than stop during runlevels 0 and 6. This is especially
> perplexing since the init script itself does absolutely nothing for
> 'start'.... All of the action happens when the script is called with
> 'stop'.
Perplexing yes, technical problem no. Attempted explanation follows.
>
> The problem appears to be in the postinst hook:
>
> # Automatically added by dh_installinit
> if [ -x "/etc/init.d/wpa-ifupdown" ]; then
> update-rc.d wpa-ifupdown start 15 0 6 . >/dev/null || exit $?
> fi
> # End automatically added section
>
> The call to update-rc.d should specify a stop set, not a start set.
It could be either. Using a 'stop' set would cause the init script to by
prefixed with K, and not S. It would be executed earlier than intended.
Look at ifupdown's postinst as another example of this sysv perplexity:
# Automatically added by dh_installinit
if [ -x "/etc/init.d/ifupdown" ]; then
update-rc.d ifupdown start 39 S . start 36 0 6 . >/dev/null || exit $?
fi
# End automatically added section
That will actually schedule /etc/init.d/ifupdown to be given the 'stop'
argument in runlevels 0 and 1.
A clearer example is probably best from initscripts:
updatercd sendsigs start 20 0 6 .
It has a no-op 'start':
case "$1" in
start)
# No-op
;;
...
The above examples were used a basis for introducing this sysv curiosity into
wpasupplicant (for better or worse).
Sequence level 15 was chosen, so it wpasupplicant could be gracefully
terminated before S20sendsigs clobbered the process. As per lsb header of
wpa-ifupdown init script:
# 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.
HTH.
Thanks, Kel.
More information about the Pkg-wpa-devel
mailing list