Package: timidity
Version: 2.13.2-7.1

I tried to run the /etc/init.d/timidity script and found that it 
didn't work (it didn't print a single line explaining something, pmidi -l did 
not showed timidity ).
So, I opened it and re-organize it, and it started working. I guess it was the 
position of the set -e command in the script.
Then, I added some few things, like d_start() and d_stop() functions, as 
described in the example script for Debian's init.d.

I can't asure this is a well-formed script but it works :-)

I attach a diff of it (if you want, I can send you the script as well, it's 
just a few kb. of size).

More data:

Package: timidity_2.13.2-7.1_i386.deb
Debian Etch (testing)
uname -a: Linux dumbledore 2.6.15-1-k7 #2 Thu Feb 2 18:48:35 UTC 2006 i686 
GNU/Linux

Yours, 

Lisandro Damián Nicanor Pérez Meyer

-- 
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark
to read.
 -- Groucho Marx

http://perezmeyer.etype.com.ar/
7a8,9
> #               This is a modified version by Lisandro Damián Nicanor
> #               Pérez Meyer <[EMAIL PROTECTED]>
9a12,14
> set -e
> 
> # Script specific configurations
11d15
< DAEMON=/usr/bin/timidity
12a17,22
> NAME=timidity
> DAEMON=/usr/bin/$NAME
> PIDFILE=/var/run/$NAME.pid
> SCRIPTNAME=/etc/init.d/$NAME
> 
> # Rest of the configurations
14c24,27
< PIDFILE=/var/run/timidity.pid
---
> TIM_ALSASEQ=
> TIM_ALSASEQPARAMS="-B2,8"
> PARAMS="${TIM_ALSASEQPARAMS} -iAD"
> START="--start --quiet --exec ${DAEMON} --pidfile ${PIDFILE} -- ${PARAMS}"
16d28
< set -e
17a30
> # Gracefully exit if the package has been removed.
21,25c34,36
< TIM_ALSASEQ=
< TIM_ALSASEQPARAMS="-B2,8"
< [ -r /etc/default/timidity ] && . /etc/default/timidity
< [ "${TIM_ALSASEQ}" != "true" ] && exit 0
< PARAMS="${TIM_ALSASEQPARAMS} -iAD"
---
> # Read config file if it is present.
> #[ -r /etc/default/timidity ] && . /etc/default/timidity
> #[ "${TIM_ALSASEQ}" != "true" ] && exit 0
27d37
< START="--start --quiet --exec ${DAEMON} --pidfile ${PIDFILE} -- ${PARAMS}"
29,33c39,43
< case "$1" in
<   start)
< 	echo -n "Starting ${DESC}: "
< 	[ -d /proc/asound ] || {
<   		echo "(ALSA is not active, cannot start)"
---
> d_start()
> {
> 	[ -d /proc/asound ] ||
> 	{
> 		echo -n "(ALSA is not active, cannot start)"
37,40c47,49
< 		echo "timidity."
<   		if [ $pmidi_enabled = "true" ] ; then
<   			sleep 1
<   			echo -n "Emulating midi on ports: ";
---
> 		if [ $pmidi_enabled = "true" ] ; then
> 			sleep 1
> 			echo -e "\nEmulating midi on ports: ";
45c54
< 			echo "(failed)."
---
> 			echo -n -e "(failed).\n"
48c57
< 			echo "already running."
---
> 			echo -n -e " already running.\n"
52,59c61,67
< 	;;
<   stop)
<   	echo -n "Stopping $DESC: "
< 	if start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
< 	   --exec ${DAEMON} --retry 10 ; then
< 		echo "timidity."
< 	else
< 		echo "(failed)."
---
> }
> 
> d_stop()
> {
> 	if ! start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
> 		--exec ${DAEMON} --retry 10 ; then
> 		echo -n -e " (failed).\n"
61a70,83
> }
> 
> 
> case "$1" in
>   start)
> 		echo -n -e "Starting ${DESC}: $NAME"
> 		d_start
> 		echo "Done."
> 	;;
> 
>   stop)
> 		echo -n -e "Stopping $DESC: $NAME"
> 		d_stop
> 		echo " Done."
62a85
> 
64,66c87,93
<   	$0 stop
< 	exec $0 start
<   	;;
---
>     echo -n -e "Restarting $DESC: $NAME"
>     d_stop
>     sleep 1
>     d_start
>     echo " Done."
> 	;;
> 
68,69c95,98
<     echo "Usage: $0 {start|stop|restart|force-reload}" >&2
<     exit 1
---
> 		echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
> 		exit 1
> 	;;
> 
71,72c100,101
<  
< exit 0						      
---
> 
> exit 0

Reply via email to