hello all... I'm new to this whole daemon thing.. trying to feel my way through. If someone could point me in the right direction, I'd be much appreciative.
I need to start my server program when the machine boots.. I figured it would need to startup at run level 3 & be started at level 4 & 5... the priority is low, so I've made links to this script in rc3, 4, &5.d as S99mlserver and in rc0,1,&2.d as K8mlserver. The script is /etc/init.d/mlserver and looks like this:
Code:
#!/bin/bash
#
# chkconfig: 345 99 8
#
# See how we were called.
case "$1" in
start)
# Start up the server
/usr/local/martianServer
;;
stop)
# Stop the server
kill -9 martianServer
;;
restart|reload)
# stop it & start it again
kill -9 martianServer
/usr/local/martianServer
;;
*)
# do not advertise unreasonable commands that there is no reason
# to use with this device
echo $"Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit 0
also... do I need to do anything with chkconfig? should that be run at some point on the command line? Does the fact that something else starts with S99 screw up the startup? I assume that when the machine starts up, it runs through the rc#.d for each of the links as "link start" (in other words it passes the "start" argument to the linked script) - is that right? Is kill -9 a good way to stop the program, or is that bad form?
and help would be great.. thanks.