#!/bin/sh
# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
start)
echo -n "Starting XXXXX: "
# daemon XXXXX
/usr/sbin/XXXXX start //启动服务程序的路径
echo " [ OK ]"
touch /var/lock/subsys/XXXXX
;;
stop)
echo -n "Shutting down XXXXX: "
killproc XXXXX
echo
rm -f /var/lock/subsys/XXXXX
rm -f /var/run/XXXXX.pid
;;
status)
status XXXXX
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading XXXXX: "
killproc XXXXX -HUP
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
注:XXXXX是服务名称。