I did understand that it`s not related to my script
problem is generated from: /etc/init.d/ispcp_daemon
Quote:stop)
log_daemon_msg "Stopping $DESC" "$NAME"
killproc -p $PID $DAEMON
log_end_msg $?
[ ! -f "$PID" ] || rm -f $PID
;;
and /lib/lsb/init-function
Quote:killproc () {
local pidfile sig status base i name_param is_term_sig
pidfile=
name_param=
is_term_sig=no
OPTIND=1
while getopts p: opt ; do
case "$opt" in
p) pidfile="$OPTARG";;
esac
done
shift $(($OPTIND - 1))
base=${1##*/}
if [ ! $pidfile ]; then
pidfile=/var/run/$base.pid
name_param="--name $base"
fi
sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/')
if [ -n "$sig" -o "$sig" = 15 -o "$sig" = TERM ]; then
is_term_sig=yes
fi
status=0
if [ ! "$is_term_sig" = yes ]; then
if [ -n "$sig" ]; then
/sbin/start-stop-daemon --stop --signal "$sig" --pidfile "$pidfile" --quiet $name_param || status="$?"
else
/sbin/start-stop-daemon --stop --pidfile "$pidfile" --quiet $name_param || status="$?"
fi
else
/sbin/start-stop-daemon --stop --pidfile "$pidfile" --retry 5 --quiet --oknodo $name_param || status="$?"
fi
if [ "$status" = 1 ]; then
if [ -n "$sig" ]; then
return 0
fi
return 0 # program is not running
fi
if [ "$status" = 0 -a "$is_term_sig" = yes ]; then
pidofproc -p $pidfile "$1" >/dev/null || rm -f "$pidfile"
fi
return 0
}
make a diff betwen mine /lib/lsb/init-function and yours maibe this is the problem
helper:
http://www.mail-archive.com/debian-dpkg-...05965.html