Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3801 - trunk/packaging/deb/surfnet_java-rrd-ma

Subject: perfsonar development work

List archive

perfsonar: r3801 - trunk/packaging/deb/surfnet_java-rrd-ma


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3801 - trunk/packaging/deb/surfnet_java-rrd-ma
  • Date: Tue, 29 Apr 2008 10:21:48 -0400

Author: gijs
Date: 2008-04-29 10:21:47 -0400 (Tue, 29 Apr 2008)
New Revision: 3801

Added:
trunk/packaging/deb/surfnet_java-rrd-ma/conffiles
trunk/packaging/deb/surfnet_java-rrd-ma/install
Modified:
trunk/packaging/deb/surfnet_java-rrd-ma/README.Debian
trunk/packaging/deb/surfnet_java-rrd-ma/control
trunk/packaging/deb/surfnet_java-rrd-ma/dirs
trunk/packaging/deb/surfnet_java-rrd-ma/init
trunk/packaging/deb/surfnet_java-rrd-ma/postinst
trunk/packaging/deb/surfnet_java-rrd-ma/postrm
trunk/packaging/deb/surfnet_java-rrd-ma/rules
Log:


Modified: trunk/packaging/deb/surfnet_java-rrd-ma/README.Debian
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/README.Debian 2008-04-29
12:21:30 UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/README.Debian 2008-04-29
14:21:47 UTC (rev 3801)
@@ -1,6 +1,7 @@
surfnet-java-flowsa-ma for Debian
---------------------------------

-<possible notes regarding this package - if none, delete this file>
+All documentation of this perfSONAR service can be found here:
+-
http://wiki.perfsonar.net/jra1-wiki/index.php/Flow_Selection_and_Aggregation_MA

-- Gijs Molenaar
<>
Tue, 29 Apr 2008 14:10:17 +0200

Added: trunk/packaging/deb/surfnet_java-rrd-ma/conffiles

Modified: trunk/packaging/deb/surfnet_java-rrd-ma/control
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/control 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/control 2008-04-29 14:21:47
UTC (rev 3801)
@@ -2,12 +2,12 @@
Section: web
Priority: extra
Maintainer: Gijs Molenaar
<>
-Build-Depends: debhelper (>= 5)
+Build-Depends: debhelper (>= 5), maven2
Standards-Version: 3.7.2

Package: surfnet-java-flowsa-ma
Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, nfdump (>= 1.5.7)
Description: PERFsonar flow selection and aggregation Measurement Archive
The Flow Selection and Aggregation MA acts as a perfSONAR interface wrapper
around the functionality of the flow capturing and processing tool, nfdump.

Modified: trunk/packaging/deb/surfnet_java-rrd-ma/dirs
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/dirs 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/dirs 2008-04-29 14:21:47
UTC (rev 3801)
@@ -1,2 +1,5 @@
/opt/perfsonar/services/surfnet_java-flowsa-ma
+/etc/surfnet_java-flowsa-ma
+/var/run/surfnet_java-flowsa-ma
+/var/lib/surfnet_java-flowsa-ma


Modified: trunk/packaging/deb/surfnet_java-rrd-ma/init
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/init 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/init 2008-04-29 14:21:47
UTC (rev 3801)
@@ -1,27 +1,5 @@
-#!/bin/sh
+#!/bin/bash
#
-# Example init.d script with LSB support.
-#
-# Please read this init.d carefully and modify the sections to
-# adjust it to the program you want to run.
-#
-# Copyright (c) 2007 Javier Fernandez-Sanguino
<>
-#
-# This is free software; you may redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2,
-# or (at your option) any later version.
-#
-# This is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License with
-# the Debian operating system, in /usr/share/common-licenses/GPL; if
-# not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-#
### BEGIN INIT INFO
# Provides: surfnet-java-flowsa-ma
# Required-Start: $network $local_fs
@@ -30,252 +8,125 @@
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
-# Short-Description: <Enter a short description of the sortware>
+# Short-Description: Startup/Shutdown nfcapd processing for the perfSONAR
flowsa-ma service
# Description: <Enter a long description of the software>
-# <...>
-# <...>
### END INIT INFO

-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+## where is the service.properties file located
+CONF=/etc/surfnet_java-flowsa-ma/service.properties

-DAEMON=/usr/sbin/surfnet-java-flowsa-ma # Introduce the server's location
here
-NAME=#PACKAGE # Introduce the short server's name here
-DESC=#PACKAGE # Introduce a short description here
-LOGDIR=/var/log/surfnet-java-flowsa-ma # Log directory to use
-
-PIDFILE=/var/run/$NAME.pid
-
-test -x $DAEMON || exit 0
-test -x $DAEMON_WRAPPER || exit 0
-
+# source lsb function library
. /lib/lsb/init-functions
+. /etc/default/rcS

-# Default options, these can be overriden by the information
-# at /etc/default/$NAME
-DAEMON_OPTS="" # Additional options given to the server
+# pull in sysconfig settings
+if [ -f /etc/sysconfig/surfnet_java-flowsa-ma ] ; then
+ . /etc/sysconfig/surfnet_java-flowsa-ma
+fi

-DODTIME=10 # Time to wait for the server to die, in seconds
- # If this value is set too low you might not
- # let some servers to die gracefully and
- # 'restart' will not work
-
-LOGFILE=$LOGDIR/$NAME.log # Server logfile
-#DAEMONUSER=surfnet-java-flowsa-ma # Users to run the daemons as. If this
value
- # is set start-stop-daemon will chuid the server

-# Include defaults if available
-if [ -f /etc/default/$NAME ] ; then
- . /etc/default/$NAME
+if [ ! -f $CONF ]; then
+ log_failure_msg "service.properties location incorrect ($CONF)"
+ exit 1;
fi

-# Use this if you want the user to explicitly set 'RUN' in
-# /etc/default/
-#if [ "x$RUN" != "xyes" ] ; then
-# log_failure_msg "$NAME disabled, please adjust the configuration to
your needs "
-# log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to
enable it."
-# 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 "nfcapd location incorrect ($NFCAPD)"
+ exit 1;
+fi

-# Check that the user exists (if we set a user)
-# Does the user exist?
-if [ -n "$DAEMONUSER" ] ; then
- if getent passwd | grep -q "^$DAEMONUSER:"; then
- # Obtain the uid and gid
- DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print
$3}'`
- DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print
$4}'`
- else
- log_failure_msg "The user $DAEMONUSER, required to run $NAME does
not exist."
- 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 "nfcapd.run folder doesn't exists ($RUNFOLDER)"
+ exit 1;
fi


-set -e
+USER=`grep ^service\.ma\.flowsa\.nfcapd\.user $CONF | cut -f 2 -d =`
+GROUP=`grep ^service\.ma\.flowsa\.nfcapd\.group $CONF | cut -f 2 -d =`

-running_pid() {
-# Check if a given process pid's cmdline matches a given name
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
- # Is this the expected server
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
+# 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 "no exporters configured in $CONF"
+ exit 1;
+fi

-running() {
-# Check if the process is running looking at /proc
-# (works for all users)
+# 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 "nfdump.source folder doesn't exists ($STORAGE)"
+ exit 1;
+fi

- # No pidfile, probably no daemon present
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE`
- running_pid $pid $DAEMON_WRAPPER || return 1
- return 0
-}
+case "$1" in
+start) log_daemon_msg "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
"service.ma.flowsa.exporter$NUM.hostname not defined in $CONF"
+ exit 1
+ fi

-start_server() {
-# Start the process using the wrapper
- if [ -z "$DAEMONUSER" ] ; then
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- else
-# if we are using a daemonuser then change the user id
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid $DAEMONUSER \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- fi
- return $errcode
-}
+ # 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 "service.ma.flowsa.exporter$NUM.PORT
not defined in $CONF"
+ exit 1
+ fi

-stop_server() {
-# Stop the process using the wrapper
- if [ -z "$DAEMONUSER" ] ; then
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --exec $DAEMON
- errcode=$
- else
-# if we are using a daemonuser then look for process that match
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$
- fi
+ PIDFILE=$RUNFOLDER/$NUM.pid

- return $errcode
-}
-
-reload_server() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE` # This is the daemon's pid
- # Send a SIGHUP
- kill -1 $pid
- return $?
-}
-
-force_stop() {
-# Force the process to die killing it manually
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- kill -15 $pid
- # Is it really dead?
- sleep "$DIETIME"s
- if running ; then
- kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
+ # check if collector sub folder is there
+ if [ ! -d $STORAGE/$HOST ]; then
+ log_daemon_msg "creating collector directory
($STORAGE/$HOST)"
+ mkdir $STORAGE/$HOST
+ if [ ! -z $USER ]; then
+ chown $USER.$GROUP $STORAGE/$HOST
fi
fi
- fi
- rm -f $PIDFILE
-}

+ # check if we should run as differnt user
+ 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"
+ fi

-case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
- # Check if it's running first
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 0
- fi
- if start_server && running ; then
- # It's ok, the server started and is running
- log_end_msg 0
- else
- # Either we could not start it or it is not running
- # after we did
- # NOTE: Some servers might die some time after they start,
- # this code does not try to detect this and might give
- # a false positive (use 'status' for that)
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- if running ; then
- # Only stop the server if we see it running
- stop_server
- log_end_msg $?
- else
- # If it's not running don't do anything
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
+ # finally run the command
+ #echo $COMMAND
+ $COMMAND
+ done
+ log_end_msg 0
;;
- force-stop)
- # First try to stop gracefully the program
- $0 stop
- if running; then
- # If it's still running try to kill it more forcefully
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- force_stop
- log_end_msg $?
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- stop_server
- # Wait some sensible amount, some server need this
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server
- running
- log_end_msg $?
- ;;
- status)

- log_daemon_msg "Checking status of $DESC" "$NAME"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 1
- fi
+stop) log_daemon_msg "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_end_msg 0
;;
- # Use this if the daemon cannot reload
- reload)
- log_warning_msg "Reloading $NAME daemon: not implemented, as the
daemon"
- log_warning_msg "cannot re-read the config file (use restart)."
+
+restart)
+ $0 stop
+ $0 start
;;
- # And this if it cann
- #reload)
- #
- # If the daemon can reload its config files on the fly
- # for example by sending it SIGHUP, do it here.
- #
- # If the daemon responds to changes in its config file
- # directly anyway, make this a do-nothing entry.
- #
- # log_daemon_msg "Reloading $DESC configuration files" "$NAME"
- # if running ; then
- # reload_server
- # if ! running ; then
- # Process died after we tried to reload
- # log_progress_msg "died on reload"
- # log_end_msg 1
- # exit 1
- # fi
- # else
- # log_progress_msg "server is not running"
- # log_end_msg 1
- # exit 1
- # fi
-
#;;

- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}"
>&2
- exit 1
+*) echo "Usage: /etc/init.d/$0 {start|stop|restart}"
+ exit 2
;;
esac
-
exit 0

Added: trunk/packaging/deb/surfnet_java-rrd-ma/install

Modified: trunk/packaging/deb/surfnet_java-rrd-ma/postinst
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/postinst 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/postinst 2008-04-29 14:21:47
UTC (rev 3801)
@@ -20,6 +20,11 @@

case "$1" in
configure)
+ ln -sf
/opt/perfsonar/services/surfnet_java-flowsa-ma/WEB-INF/classes/perfsonar/conf/*
/etc/surfnet_java-flowsa-ma || true
+ ln -s /opt/perfsonar/services/surfnet_java-flowsa-ma
/opt/perfsonar/tomcat/webapps || true
+ chgrp perfsonar /var/run/surfnet_java-flowsa-ma
+ chmod 775 /var/run/surfnet_java-flowsa-ma
+ /etc/init.d/perfsonar-tomcat restart
;;

abort-upgrade|abort-remove|abort-deconfigure)

Modified: trunk/packaging/deb/surfnet_java-rrd-ma/postrm
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/postrm 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/postrm 2008-04-29 14:21:47
UTC (rev 3801)
@@ -20,8 +20,13 @@


case "$1" in
-
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ purge)
+ rm /etc/surfnet_java-flowsa-ma/*
+ rm /opt/perfsonar/tomcat/webapps/surfnet_java-flowsa-ma
;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;

*)
echo "postrm called with unknown argument \`$1'" >&2

Modified: trunk/packaging/deb/surfnet_java-rrd-ma/rules
===================================================================
--- trunk/packaging/deb/surfnet_java-rrd-ma/rules 2008-04-29 12:21:30
UTC (rev 3800)
+++ trunk/packaging/deb/surfnet_java-rrd-ma/rules 2008-04-29 14:21:47
UTC (rev 3801)
@@ -1,13 +1,7 @@
#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1



@@ -16,7 +10,6 @@
configure-stamp:
dh_testdir
# Add here commands to configure the package.
-
touch configure-stamp


@@ -24,21 +17,15 @@

build-stamp: configure-stamp
dh_testdir
+ mvn package

- # Add here commands to compile the package.
- $(MAKE)
- #docbook-to-man debian/surfnet-java-flowsa-ma.sgml >
surfnet-java-flowsa-ma.1
-
touch $@

clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- -$(MAKE) clean
-
+ rm -rf build
dh_clean

install: build
@@ -47,10 +34,7 @@
dh_clean -k
dh_installdirs

- # Add here commands to install the package into
debian/surfnet-java-flowsa-ma.
- $(MAKE) DESTDIR=$(CURDIR)/debian/surfnet-java-flowsa-ma install

-
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@@ -62,23 +46,13 @@
dh_installchangelogs
dh_installdocs
dh_installexamples
-# dh_install
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
+ dh_install
+ dh_installinit
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
-# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps



  • perfsonar: r3801 - trunk/packaging/deb/surfnet_java-rrd-ma, svnlog, 04/29/2008

Archive powered by MHonArc 2.6.16.

Top of Page