#!/bin/sh## <daemonname> <summary>## chkconfig: <default runlevel(s)> <start> <stop># description: <description, split multiple lines with \# a backslash>### BEGIN INIT INFO# Provides: # Required-Start: # Required-Stop: # Should-Start: # Should-Stop: # Default-Start: # Default-Stop: # Short-Description: # Description: ### END INIT INFO# Source function library../etc/rc.d/init.d/functionsexec="/path/to/<daemonname>"prog="<service name>"config="<path to major config file>"[-e/etc/sysconfig/$prog]&&./etc/sysconfig/$proglockfile=/var/lock/subsys/$progstart(){[-x$exec]||exit5[-f$config]||exit6echo-n$"Starting $prog: "# if not running, start it up here, usually something like "daemon $exec"retval=$?echo[$retval-eq0]&&touch$lockfilereturn$retval}stop(){echo-n$"Stopping $prog: "# stop it here, often "killproc $prog"retval=$?echo[$retval-eq0]&&rm-f$lockfilereturn$retval}restart(){stopstart}reload(){restart}force_reload(){restart}rh_status(){# run checks to determine if the service is running or use generic statusstatus$prog}rh_status_q(){rh_status>/dev/null2>&1}case"$1"instart)rh_status_q&&exit0$1;;stop)rh_status_q||exit0$1;;restart)$1;;reload)rh_status_q||exit7$1;;force-reload)force_reload;;status)rh_status;;condrestart|try-restart)rh_status_q||exit0restart;;*)echo$"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"exit2esacexit$?