Группа :: Мониторинг
Пакет: nfdump
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# nfcapd netflow collector daemon
#
# chkconfig: 2345 75 25
# description: Reads the netflow data from the network \
# and stores the flow records into files.
# processname: nfcapd
# config: /etc/sysconfig/nfcapd
# pidfile: /var/run/nfcapd/nfcapd.pid
### BEGIN INIT INFO
# Provides: nfcapd
# Required-Start: $network
# Required-Stop: $network
# Default-Start:
# Default-Stop:
# Short-Description: Start nfcapd at boot time
# Description: Start netflow collector daemon "nfcapd" at boot time
### END INIT INFO
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
PIDFILE=/var/run/nfcapd/nfcapd.pid
LOCKFILE=/var/lock/subsys/nfcapd
USER=nfcapd
GROUP=nfcapd
DAEMON=nfcapd
SYSCONFIGFILE=/etc/sysconfig/nfcapd
PIDFILE=/var/run/nfcapd/nfcapd.pid
CACHE_DIR=/var/cache/nfcapd
ARGS="-D -u $USER -g $GROUP -P $PIDFILE -l $CACHE_DIR"
RETVAL=0
SourceIfNotEmpty $SYSCONFIGFILE
start()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user $USER -- $DAEMON $ARGS $EXTRA_ARGS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user $USER -- $DAEMON
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading template
stop_daemon --pidfile "$PIDFILE" --expect-user $USER -HUP -- $DAEMON
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user $USER -- $DAEMON
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL