Blame | Last modification | View Log | RSS feed
#!/bin/sh## APPNAME - <summary>## chkconfig: <default runlevel(s)> <start> <stop># description: <description, split multiple lines with \# a backslash># http://fedoraproject.org/wiki/FCNewInit/Initscripts### 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="/usr/sbin/APPNAME"prog=$(basename $exec)[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$proglockfile=/var/lock/subsys/$progstart() {echo -n $"Starting $prog: "# if not running, start it up here, usually something like "daemon $exec"retval=$?echo[ $retval -eq 0 ] && touch $lockfilereturn $retval}stop() {echo -n $"Stopping $prog: "# stop it here, often "killproc $prog"retval=$?echo[ $retval -eq 0 ] && rm -f $lockfilereturn $retval}restart() {stopstart}case "$1" instart|stop|restart)$1;;force-reload)restart;;status)status $prog;;try-restart|condrestart)if status $prog >/dev/null ; thenrestartfi;;reload)# If config can be reloaded without restarting, implement it here,# remove the "exit", and add "reload" to the usage message below.# For example:# status $prog >/dev/null || exit 7# killproc $prog -HUPaction $"Service ${0##*/} does not support the reload action: " /bin/falseexit 3;;*)echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"exit 2esac