sec/sec.init
Stefan Schulze Frielinghaus d106b2f2cd - New upstream release
- SPEC file cleanup
- Init script cleanup
- Removed some examples because of licensing issues. Upstream has clarified
    and changed most of the license tags to GPLv2. Additionally, upstream
    will include the examples in the next release.
- Removed a provide statement since a period was in the name and no other
    package required that special name.
2009-10-03 07:35:41 +00:00

102 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
#
# sec Start and stop SEC.
#
# chkconfig: - 20 80
# description: Simple Event Correlator script to filter log file entries
. /etc/rc.d/init.d/functions
prog="sec"
exec="/usr/bin/sec"
lockfile="/var/lock/subsys/sec"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
[ -x $exec ] || exit 5
for n in `seq 0 $((${#SEC_ARGS[*]} - 1))`; do
echo -n $"Starting $prog instance "$(($n + 1))": "
daemon $exec ${SEC_ARGS[$n]}
RETVAL=$?
echo
[ $RETVAL -ne 0 ] && return $RETVAL
done
touch $lockfile
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $prog: "
killproc $prog -HUP
RETVAL=$?
echo
return $RETVAL
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
dump() {
echo -n $"Dumping state of $prog in /tmp/sec.dump: "
killproc $prog -USR1
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
reload)
reload
;;
force-reload)
force_reload
;;
status)
rh_status
;;
dump)
dump
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|dump}"
exit 2
esac
exit $?