The fact that this isn't documented in chkconfig is a real pain in the rear but here's the answer.
/etc/rc is the script responsible for running each script in /etc/rc*.d. Before running each K* script, rc performs the following check.
Code:
# Check if the subsystem is already up.
subsys=${i#/etc/rc$runlevel.d/S??}
[ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \
&& continue
If your script is called K01snowdog, then rc looks for /var/lock/subsys/snowdog or /var/lock/subsys/snowdog.init. If either of these files exist then "K01snowdog stop" is executed. If neither snowdog nor snowdog.init exist "K01snowdog stop" will not be called.
You need to change your script to create and destroy the correct file in /var/lock/subsys:
Code:
start)
touch /var/lock/subsys/snowdog
echo "Start" >> $logfile
;;
stop)
echo "Stop" >> $logfile
rm -f /var/lock/subsys/snowdog
;;