# rc script for cflowd 2.x # D Plonka, May 3 1999 # # sab 2000.10.02 # Provide correct paths for this server. # comment out default values # # sab 2000.10.11 # Modify script so that it starts cfdcollect as well. this will correct # the memory overflow problem when cflowd runs for extended periods (days) # bindir=/usr/local/arts/sbin logfile=/dev/null #conf=/usr/local/etc/cflowd.conf conf=/usr/local/arts/etc/cflowd.conf # # sab 2000.10.11 # Provide path to config file for cfdcollect # conf2=/usr/local/arts/etc/cfdcollect.conf # #user=net user=netadmin su=/bin/su nohup=/usr/bin/nohup kill=/bin/kill ps=/bin/ps grep=/bin/grep awk=/usr/bin/awk #nice=/usr/bin/nice nice=/bin/nice niceness=0 case "$1" in 'start') echo "starting cflowdmux" ${nice} --${niceness} ${su} - ${user} -c "${bindir}/cflowdmux ${conf}" echo "starting cflowd" ${nice} --${niceness} ${su} - ${user} -c "${bindir}/cflowd -s 300 -O 0 -m ${conf}" # # sab 2000.10.11 # Provide code to start cfdcollect # echo "starting cfdcollect" ${nice} --${niceness} ${su} - ${user} -c "${bindir}/cfdcollect ${conf2}" ;; 'stop') # # sab 2000.10.11 # Provide code to stop cfdcollect # echo "killing cfdcollect" pid=`${ps} ax |${grep} "${bindir}/[c]fdcollect " |${awk} '{print $1}'` if [ -n "$pid" ] then ${kill} $pid fi echo "killing cflowd" pid=`${ps} ax |${grep} "${bindir}/[c]flowd " |${awk} '{print $1}'` if [ -n "$pid" ] then ${kill} $pid fi echo "killing cflowdmux" pid=`${ps} ax |${grep} "${bindir}/[c]flowdmux " |${awk} '{print $1}'` if [ -n "$pid" ] then ${kill} $pid fi ;; esac