#!/bin/sh # template Summary of the service. # # chkconfig: 345 11 90 # description: multi-line \ # description \ # of the service. # processname: flow-capture # config: /etc/sysconfig/flow-capture # pidfile: /var/run/flow-capture.pid # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions CONFIG=/etc/sysconfig/flow-capture BIN=/usr/bin/flow-capture PIDFILE=/var/run/flow-capture/flow-capture.pid RETVAL=0 [ -x $BIN ] || exit 0 [ -f $CONFIG ] || exit 0 SourceIfNotEmpty $CONFIG start() { start_daemon --user _flow -- $BIN -w $STORE_PATH -E $MAX_STORE_SIZE -n $ROTATIONS -N $NESTING_LEVEL -z $COMPRESSION -p $PIDFILE $LOCALIP/$REMOTEIP/$PORT $OPTIONS RETVAL=$? if [ $RETVAL = 0 ]; then mv -f $PIDFILE.$PORT $PIDFILE else rm -f $PIDFILE.$PORT $PIDFILE fi return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --expect-user _flow -- $BIN RETVAL=$? return $RETVAL } restart() { stop start } reload() { msg_reloading flow-capture stop_daemon --pidfile "$PIDFILE" --expect-user _flow -HUP -- $BIN RETVAL=$? return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condstop) if [ -e "$PIDFILE" ]; then stop fi ;; condrestart) if [ -e "$PIDFILE" ]; then restart fi ;; condreload) if [ -e "$PIDFILE" ]; then reload fi ;; status) status --pidfile "$PIDFILE" --expect-user _flow -- $BIN RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL