perfsonar-dev - perfsonar: r4006 - in trunk/surfnet_java-flowsa-ma: . contrib
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r4006 - in trunk/surfnet_java-flowsa-ma: . contrib
- Date: Mon, 16 Jun 2008 07:53:24 -0400
Author: gijs
Date: 2008-06-16 07:53:24 -0400 (Mon, 16 Jun 2008)
New Revision: 4006
Removed:
trunk/surfnet_java-flowsa-ma/debian/
Modified:
trunk/surfnet_java-flowsa-ma/contrib/surfnet_java-flowsa-ma.rc
Log:
Modified: trunk/surfnet_java-flowsa-ma/contrib/surfnet_java-flowsa-ma.rc
===================================================================
--- trunk/surfnet_java-flowsa-ma/contrib/surfnet_java-flowsa-ma.rc
2008-06-13 17:33:07 UTC (rev 4005)
+++ trunk/surfnet_java-flowsa-ma/contrib/surfnet_java-flowsa-ma.rc
2008-06-16 11:53:24 UTC (rev 4006)
@@ -1,42 +1,27 @@
#!/bin/bash
#
-# chkconfig: 345 91 19
-# description: Startup/Shutdown nfcapd processing for the perfSONAR \
-# flowsa-ma service
-#
-# $Id:surfnet_java-flowsa-ma.rc 3773 2008-04-22 14:28:50Z gijs $
-# $Revision:3773 $
+# Startup/Shutdown nfcapd processing for the perfSONAR flowsa-ma service
## where is the service.properties file located
-CONF=/etc/surfnet_java-flowsa-ma/service.properties
+CONF=/etc/surfnet-java-flowsa-ma/service.properties
-# source function library
-[ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions
-
-# source lsb function library
-[ -f /lib/lsb/init-functions ] && . /lib/lsb/init-functions
-
-# pull in sysconfig settings
-[ -f /etc/sysconfig/flowsa-nfcapd ] && . /etc/sysconfig/flowsa-nfcapd
-
-
-if [[ ! -f $CONF ]]; then
- log_failure_msg "ERROR: service.properties location incorrect ($CONF)"
+if [ ! -f $CONF ]; then
+ echo "service.properties location incorrect ($CONF)"
exit 1;
fi
# get nfcapd location
NFCAPD=`grep ^service\.ma\.flowsa\.nfcapd\.location $CONF | cut -f 2 -d =`
if [ ! -x $NFCAPD ] || [ -z $NFCAPD ]; then
- log_failure_msg "ERROR: nfcapd location incorrect ($NFCAPD)"
+ echo "nfcapd location incorrect ($NFCAPD)"
exit 1;
fi
# where should the pid files be stored
RUNFOLDER=`grep ^service\.ma\.flowsa\.nfcapd\.run $CONF | cut -f 2 -d =`
if [ ! -d $RUNFOLDER ] || [ -z $RUNFOLDER ]; then
- log_failure_msg "ERROR: nfcapd.run folder doesn't exists
($RUNFOLDER)"
+ echo "nfcapd.run folder doesn't exists ($RUNFOLDER)"
exit 1;
fi
@@ -47,48 +32,48 @@
# get number of configured exporters && check if > 0
#EXPNUM=`grep ^service\.ma\.flowsa\.exporter.*\.hostname $CONF | wc -l`
EXPNUM=`grep ^service\.ma\.flowsa\.exporters $CONF | cut -f 2 -d =`
-if [[ $EXPNUM == 0 ]]; then
- log_failure_msg "ERROR: no exporters configured in $CONF"
+if [ $EXPNUM == 0 ]; then
+ echo "no exporters configured in $CONF"
exit 1;
fi
# get nfcapd storage location
STORAGE=`grep ^service\.ma\.flowsa\.nfdump\.source $CONF | cut -f 2 -d =`
if [ ! -d $STORAGE ] || [ -z $STORAGE ]; then
- log_failure_msg "ERROR: nfdump.source folder doesn't exists
($RUNFOLDER)"
+ echo "nfdump.source folder doesn't exists ($STORAGE)"
exit 1;
fi
case "$1" in
-start) echo -n "Starting PERFsonar flow-sa-ma collector(s)"
+start) echo "Starting PERFsonar flow-sa-ma collector(s)"
for NUM in `seq $EXPNUM`; do
# read hostname from properties file, and check if it exists
HOST=`grep ^service\.ma\.flowsa\.exporter$NUM\.hostname $CONF
| cut -f 2 -d =`
- if [[ -z $HOST ]]; then
- log_failure_msg "ERROR:
service.ma.flowsa.exporter$NUM.hostname not defined in $CONF"
+ if [ -z $HOST ]; then
+ echo "service.ma.flowsa.exporter$NUM.hostname not
defined in $CONF"
exit 1
fi
# read port from properties file, and check if it exists
PORT=`grep ^service\.ma\.flowsa\.exporter$NUM\.port $CONF |
cut -f 2 -d =`
- if [[ -z $PORT ]]; then
- log_failure_msg "ERROR:
service.ma.flowsa.exporter$NUM.PORT not defined in $CONF"
+ if [ -z $PORT ]; then
+ echo "service.ma.flowsa.exporter$NUM.PORT not defined
in $CONF"
exit 1
fi
PIDFILE=$RUNFOLDER/$NUM.pid
# check if collector sub folder is there
- if [[ ! -d $STORAGE/$HOST ]]; then
+ if [ ! -d $STORAGE/$HOST ]; then
echo "creating collector directory ($STORAGE/$HOST)"
mkdir $STORAGE/$HOST
- if [[ ! -z $USER ]]; then
+ if [ ! -z $USER ]; then
chown $USER.$GROUP $STORAGE/$HOST
fi
fi
# check if we should run as differnt user
- if [[ -z $USER ]]; then
+ if [ -z $USER ]; then
COMMAND="$NFCAPD -e -p $PORT -w -t 300 -D -l
$STORAGE/$HOST -I $HOST -P $PIDFILE"
else
COMMAND="$NFCAPD -e -p $PORT -u $USER -g $GROUP -w -t
300 -D -l $STORAGE/$HOST -I $HOST -P $PIDFILE"
@@ -98,22 +83,17 @@
#echo $COMMAND
$COMMAND
done
- log_success_msg
+ echo 0
;;
-stop) echo -n "Stopping PERFsonar flow-sa-ma collector(s)"
+stop) echo "Stopping PERFsonar flow-sa-ma collector(s)"
for PIDFILE in `ls $RUNFOLDER`; do
PID=`cat $RUNFOLDER/$PIDFILE`
#echo "killing nfcapd with pid $PID"
kill $PID
- ##removing PID file
- #if [[ -f $RUNFOLDER/$PIDFILE ]]; then
- # echo "cleaning up pid file"
- # rm $RUNFOLDER/$PIDFILE
- #fi
done
- log_success_msg
+ echo 0
;;
restart)
- perfsonar: r4006 - in trunk/surfnet_java-flowsa-ma: . contrib, svnlog, 06/16/2008
Archive powered by MHonArc 2.6.16.