Blame | Letzte Änderung | Log anzeigen | RSS feed
#!/bin/bash## /etc/rc.d/init.d/@name@## chkconfig: @chkconfig@# description: @desc@# processname: @bin_name@# pidfile: @pid_file@PID_FILE=@pid_file@BIN_FILE=@bin_file@# Source function library.. /etc/rc.d/init.d/functionsstart() {${BIN_FILE}ret=$?if [ $ret -eq 0 ]; thenaction $"Starting @name@: " /bin/trueelseaction $"Starting @name@: " /bin/falsefireturn $ret}stop() {PID=`cat @pid_file@ 2>/dev/null `if [ -n "$PID" ]; then/bin/kill "$PID" >/dev/null 2>&1ret=$?if [ $ret -eq 0 ]; thenSTOPTIMEOUT=60while [ $STOPTIMEOUT -gt 0 ]; do/bin/kill -0 "$PID" >/dev/null 2>&1 || breaksleep 1let STOPTIMEOUT=${STOPTIMEOUT}-1doneif [ $STOPTIMEOUT -eq 0 ]; thenecho "Timeout error occurred trying to stop @name@."ret=1action $"Stopping @name@: " /bin/falseelseaction $"Stopping @name@: " /bin/truefielseaction $"Stopping @name@: " /bin/falsefielseret=1action $"Stopping @name@: " /bin/falsefireturn $ret}case "$1" instart)start;;stop)stop;;restart)stopstart;;reload)restart;;status)status @name@;;*)echo "Usage: @name@ [start|stop|restart|status]"exit 1;;esac