#! /bin/sh # backgroundjob_<%= application %>: Backgroundjob daemon for <%= application %> # # chkconfig: - 86 14 # description: backgroundjob daemon # processname: bj # # Author: Gabriel Handford http://ducktyper.com # Source function library . /etc/rc.d/init.d/functions RETVAL=0 DESC="backgroundjob daemon (<%= application %>)" BIN_PATH="<%= backgroundjob_bin_path %>" PID_FILE="<%= backgroundjob_pid_path %>" start() { echo -n $"Starting $DESC: " daemon --user sick $BIN_PATH RETVAL=$? echo return $RETVAL; } stop() { echo -n $"Stopping $DESC:" killproc -p $PID_FILE RETVAL=$? echo return $RETVAL; } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start RETVAL=$?; ;; *) echo "Usage: $0 {start|stop|restart}" >&2 RETVAL=3; ;; esac exit $RETVAL;