[Pkg-alsa-devel] Bug#269494: /etc/init.d/alsa: force-stop fails on disappeared process
Thomas Hood
Thomas Hood <jdthood@yahoo.co.uk>, 269494@bugs.debian.org
Wed, 01 Sep 2004 21:34:30 +0200
Package: alsa-base
Version: 1.0.5a-3
Severity: important
Tags: patch
The initscript exits in the force-stop method if the kill command fails
because it is trying to kill a process that is already dead. (The
script runs with the -e option.) Here is a patch that fixes this problem
and also improves the effort at sound process genocide.
--- alsa_ORIG 2004-08-23 13:46:22.000000000 +0200
+++ alsa 2004-09-01 21:01:06.000000000 +0200
@@ -42,12 +42,18 @@
fi
;;
force-stop|force-reload)
- procs_using_sound="$(lsof +D /dev -F rt | awk '/^p/ {pid=$1} /^t/ {type=$1} /^r0x(74|e)..$/ && type == "tCHR" {print pid}' | cut -c 2- | uniq)"
+ set_procs_using_sound() {
+ procs_using_sound="$(lsof +D /dev -F rt | awk '/^p/ {pid=$1} /^t/ {type=$1} /^r0x(74|e)..$/ && type == "tCHR" {print pid}' | cut -c 2- | uniq)"
+ }
+ set_procs_using_sound
if [ ! -z "$procs_using_sound" ]; then
printf "Terminating processes ... "
- kill $procs_using_sound
+ kill $procs_using_sound || :
sleep 2
- kill -9 $procs_using_sound
+ set_procs_using_sound
+ if [ ! -z "$procs_using_sound" ]; then
+ kill -9 $procs_using_sound || :
+ fi
echo "done"
fi
$0 stop
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: LANG=en_IE@euro, LC_CTYPE=en_IE@euro
Versions of packages alsa-base depends on:
ii alsa-utils 1.0.5-3 Advanced Linux Sound Architecture
ii debconf 1.4.32 Debian configuration management sy
ii debianutils 2.8.4 Miscellaneous utilities specific t
ii module-init-tools 3.1-pre5-6 tools for managing Linux kernel mo
ii modutils 2.4.26-1 Linux module utilities
ii psmisc 21.5-1 Utilities that use the proc filesy
-- debconf information:
* alsa-base/alsactl_store_on_shutdown: never autosave