Skip to content
Snippets Groups Projects
Commit 38f233c0 authored by Ruud Overeem's avatar Ruud Overeem
Browse files

Bug 1000: swlevel checks if it is running on a PVSS system or not. If not it ignores

the LoggingProcessor program otherwise it ignores the LoggingClient.
In this way the distribution of the Logging software is trivial. Both programs can be 
distributed but only one of them is started.
parent 057247f2
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# #
# $Id$ # $Id$
# #
VERSION="v1.4 20071017" # added possibility for custom scripts VERSION="v1.5 20081112" # added possibility for custom scripts
BINDIR=/opt/lofar/bin BINDIR=/opt/lofar/bin
LOGDIR=/opt/lofar/log LOGDIR=/opt/lofar/log
LEVELTABLE=${BINDIR}/../etc/swlevel.conf LEVELTABLE=${BINDIR}/../etc/swlevel.conf
...@@ -40,12 +40,12 @@ SyntaxError() ...@@ -40,12 +40,12 @@ SyntaxError()
echo "" echo ""
echo "Syntax: $(basename $0) [ 0 | 1 | 2 | 3 | 4 | 5 | 6 ]" echo "Syntax: $(basename $0) [ 0 | 1 | 2 | 3 | 4 | 5 | 6 ]"
echo "0: stop all lofar software" echo "0: stop all lofar software"
echo "1: Lofar daemons are running" echo "1: Lofar daemons and PVSS"
echo "2: RSPDriver is running" echo "2: Lowlevel hardware drivers"
echo "3: PVSS database is running" echo "3: Calculation services"
echo "4: Hardwaremonitor is running" echo "4: Hardware and software monitors"
echo "5: Servers are running" echo "5: System Health Management"
echo "6: Full MAC is running" echo "6: MAC is controlling the software"
echo "" echo ""
exit 1 exit 1
} }
...@@ -60,9 +60,12 @@ start_prog() ...@@ -60,9 +60,12 @@ start_prog()
asroot=${2:1} asroot=${2:1}
withmpi=${3:1} withmpi=${3:1}
# special check for logging-daemons
[ $prog == $logProgToSkip ] && return
# check existance # check existance
[ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || return [ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || return
# if it is a shell script call the script # if it is a shell script call the script
if [ -f $BINDIR/${prog}.sh ]; then if [ -f $BINDIR/${prog}.sh ]; then
$BINDIR/${prog}.sh start $BINDIR/${prog}.sh start
...@@ -112,6 +115,9 @@ stop_prog() ...@@ -112,6 +115,9 @@ stop_prog()
withmpi=${3:1} withmpi=${3:1}
[ ! -z "$asroot" ] && asroot=sudo [ ! -z "$asroot" ] && asroot=sudo
# special check for logging-daemons
[ $prog == $logProgToSkip ] && return
# check existance # check existance
[ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || return [ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || return
...@@ -174,6 +180,9 @@ status_prog() ...@@ -174,6 +180,9 @@ status_prog()
levelnr=`echo $line | cut -d":" -f1` levelnr=`echo $line | cut -d":" -f1`
prog=`echo $line | cut -d":" -f6` prog=`echo $line | cut -d":" -f6`
# special check for logging-daemons
[ $prog == $logProgToSkip ] && continue
# check existance # check existance
[ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || continue [ -x $BINDIR/$prog ] || [ -x $BINDIR/${prog}.sh ] || continue
...@@ -243,6 +252,13 @@ goto_level() ...@@ -243,6 +252,13 @@ goto_level()
# MAIN # MAIN
# #
# Find out if we are running on a PVSS system
# Note: on PVSS systems LoggingClient must be ignored on non-PVSS system LoggingProcessor.
logProgToSkip=LoggingProcessor
if [ -f ${BINDIR}/PVSS00pmon ]; then
logProgToSkip=LoggingClient
fi
# when no argument is given show current level # when no argument is given show current level
if [ -z "$1" ]; then if [ -z "$1" ]; then
level=`cat /tmp/level.admin` level=`cat /tmp/level.admin`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment