I have a simple script that I have put in all the rc.d directories from 1-6 and have named it K20blah and S20blah .I am on red hat linux and I see that when i do reboot the S20blah is ignored but the K20blah is executed during startup . Any suggestions?
#! /bin/sh
# /etc/init.d/blah
#
# Some things that run always
touch /var/lock/blah
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script blah " >start.out
echo "Could do more here"
;;
stop)
echo "Stopping script blah">stop.out
echo "Could do more here"
;;
*)
echo "Usage: /etc/init.d/blah {start|stop}"
exit 1
;;
esac
exit 0
One query:
Do you say that "K" script is getting called while system start up?
Two things:
When you do reboot your "K" scripts won't be called, it is not graceful shutdown of system. Please check for difference between "reboot" and "init 6", it would help.
Proper way is to put script in /etc/init.d, and making symbolic links for rc*.d directories to /etc/init.d with proper "S" and "K" notation.