Search
j0ke.net Open Build Service
>
Projects
>
ha
:
firewall
>
barnyard2
> barnyard2-rh.init
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File barnyard2-rh.init of Package barnyard2
#!/bin/sh # # Init file for Barnyard2 # # # chkconfig: 2345 40 60 # description: Barnyard2 is an output processor for snort. # # processname: barnyard2 # config: /etc/sysconfig/barnyard2 # config: /etc/snort/barnyard.conf # pidfile: /var/lock/subsys/barnyard2.pid source /etc/rc.d/init.d/functions source /etc/sysconfig/network ### Check that networking is up. [ "${NETWORKING}" == "no" ] && exit 0 [ -x /usr/sbin/snort ] || exit 1 [ -r /etc/snort/snort.conf ] || exit 1 ### Default variables SYSCONFIG="/etc/sysconfig/barnyard2" ### Read configuration [ -r "$SYSCONFIG" ] && source "$SYSCONFIG" RETVAL=0 prog="barnyard2" desc="Snort Output Processor" start() { echo -n $"Starting $desc ($prog): " for INT in $INTERFACES; do PIDFILE="/var/lock/subsys/barnyard2-$INT.pid" ARCHIVEDIR="$SNORTDIR/$INT/archive" WALDO_FILE="$SNORTDIR/$INT/barnyard2.waldo" mkdir -p ${ARCHIVEDIR} `dirname ${WALDO_FILE}` chown -R ${USER}:${GROUP} ${ARCHIVEDIR} `dirname ${WALDO_FILE} BARNYARD_OPTS="-D -c $CONF -d ${SNORTDIR}/${INT} -w $WALDO_FILE -a $ARCHIVEDIR -f $LOG_FILE -X $PIDFILE $EXTRA_ARGS" daemon $prog $BARNYARD_OPTS done RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog return $RETVAL } stop() { echo -n $"Shutting down $desc ($prog): " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL } restart() { stop start } reload() { echo -n $"Reloading $desc ($prog): " killproc $prog -HUP RETVAL=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; condrestart) [ -e /var/lock/subsys/$prog ] && restart RETVAL=$? ;; status) status $prog RETVAL=$? ;; dump) dump ;; *) echo $"Usage: $0 {start|stop|restart|reload|condrestart|status|dump}" RETVAL=1 esac exit $RETVAL