Changes of Revision 17
[-] [+] | Changed | pmacct.spec |
[-] [+] | Added | nfacctd.init.rh ^ |
@@ -0,0 +1,92 @@ +#!/bin/bash +# +# Init script for pmacct network monitoring tool. +# +# Original by Dag Wieers <dag@wieers.com>. +# Modified for pmacct by Karl Latiss <karl.latiss@atvert.com.au>. +# +# chkconfig: 2345 13 86 +# description: pmacct network monitoring tool. +# +# processname: nfacctd +# config: /etc/pmacct/nfacctd.conf +# pidfile: /var/run/nfacctd.pid + +source /etc/rc.d/init.d/functions + +[ -x /usr/sbin/nfacctd ] || exit 1 +[ -r /etc/pmacct/nfacctd.conf ] || exit 1 + +### Default variables +CONFIG_FILE="/etc/pmacct/nfacctd.conf" + +RETVAL=0 +prog="nfacctd" +desc="nfacct network monitoring" + +start() { + echo -n $"Starting $desc ($prog): " + /usr/sbin/$prog -f "$CONFIG_FILE" + RETVAL=$? + if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +stop() { + echo -n $"Shutting down $desc ($prog): " + killproc $prog + RETVAL=$? + if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +reload() { + echo -n $"Reloading $desc ($prog): " + killproc $prog -HUP + RETVAL=$? + echo + return $RETVAL +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + condrestart) + [ -e /var/lock/subsys/$prog ] && restart + RETVAL=$? + ;; + status) + status $prog + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 +esac + +exit $RETVAL | ||
[-] [+] | Added | pmacctd.init.rh ^ |
@@ -0,0 +1,92 @@ +#!/bin/bash +# +# Init script for pmacct network monitoring tool. +# +# Original by Dag Wieers <dag@wieers.com>. +# Modified for pmacct by Karl Latiss <karl.latiss@atvert.com.au>. +# +# chkconfig: 2345 13 86 +# description: pmacct network monitoring tool. +# +# processname: pmacctd +# config: /etc/pmacct/pmacctd.conf +# pidfile: /var/run/pmacctd.pid + +source /etc/rc.d/init.d/functions + +[ -x /usr/sbin/pmacctd ] || exit 1 +[ -r /etc/pmacct/pmacctd.conf ] || exit 1 + +### Default variables +CONFIG_FILE="/etc/pmacct/pmacctd.conf" + +RETVAL=0 +prog="pmacctd" +desc="pmacct network monitoring" + +start() { + echo -n $"Starting $desc ($prog): " + /usr/sbin/$prog -f "$CONFIG_FILE" + RETVAL=$? + if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +stop() { + echo -n $"Shutting down $desc ($prog): " + killproc $prog + RETVAL=$? + if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +reload() { + echo -n $"Reloading $desc ($prog): " + killproc $prog -HUP + RETVAL=$? + echo + return $RETVAL +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + condrestart) + [ -e /var/lock/subsys/$prog ] && restart + RETVAL=$? + ;; + status) + status $prog + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 +esac + +exit $RETVAL | ||
[-] [+] | Added | sfacctd.init.rh ^ |
@@ -0,0 +1,92 @@ +#!/bin/bash +# +# Init script for pmacct network monitoring tool. +# +# Original by Dag Wieers <dag@wieers.com>. +# Modified for pmacct by Karl Latiss <karl.latiss@atvert.com.au>. +# +# chkconfig: 2345 13 86 +# description: pmacct network monitoring tool. +# +# processname: sfacctd +# config: /etc/pmacct/sfacctd.conf +# pidfile: /var/run/sfacctd.pid + +source /etc/rc.d/init.d/functions + +[ -x /usr/sbin/sfacctd ] || exit 1 +[ -r /etc/pmacct/sfacctd.conf ] || exit 1 + +### Default variables +CONFIG_FILE="/etc/pmacct/sfacctd.conf" + +RETVAL=0 +prog="sfacctd" +desc="sfacct network monitoring" + +start() { + echo -n $"Starting $desc ($prog): " + /usr/sbin/$prog -f "$CONFIG_FILE" + RETVAL=$? + if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +stop() { + echo -n $"Shutting down $desc ($prog): " + killproc $prog + RETVAL=$? + if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog ; then + echo_success + echo + else + echo_failure + echo + fi +} + +reload() { + echo -n $"Reloading $desc ($prog): " + killproc $prog -HUP + RETVAL=$? + echo + return $RETVAL +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + condrestart) + [ -e /var/lock/subsys/$prog ] && restart + RETVAL=$? + ;; + status) + status $prog + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 +esac + +exit $RETVAL |