From b8ab1ccea83bc2d8f99a7df8e6ba10c5d2c71740 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Apr 2012 00:53:38 +0200 Subject: Modernize local flowscan SysV init script. --- init.d/local-flowscan | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'init.d') diff --git a/init.d/local-flowscan b/init.d/local-flowscan index 171e20f..f6eeecb 100755 --- a/init.d/local-flowscan +++ b/init.d/local-flowscan @@ -1,10 +1,12 @@ #!/bin/sh -e -# -# flowscan Transforms Cisco netflow files into rrd files. -# -# chkconfig: 345 20 20 -# -# description: Start / stop the netflow recorder +### BEGIN INIT INFO +# Provides: flowscan +# Required-Start: $local_fs $remote_fs $syslog $time +# Required-Stop: $local_fs $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: transforms Cisco netflow files into rrd files +### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/flowscan @@ -16,7 +18,7 @@ test -f $CONFIG || exit 0 startstop() { local background= - [[ "$1" != "--start" ]] || background="--background" + [ "$1" != "--start" ] || background="--background" start-stop-daemon "$@" $background --make-pidfile --name ${DAEMON##*/} \ --pidfile="/var/run/${DAEMON##*/}.pid" --startas "$DAEMON" } @@ -33,8 +35,9 @@ case "$1" in echo "${DAEMON##*/}." ;; restart|force-reload) - echo -n "Reloading $DESC: " + echo -n "Restarting $DESC: " startstop --stop --oknodo --quiet + sleep 3 startstop --start echo "${DAEMON##*/}." ;; -- cgit v1.2.3