Skip to content
Snippets Groups Projects
Commit 17132585 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #5385: Added swlevel support for Cobalt (called 'CobaltControl')

parent 109e695b
No related branches found
No related tags found
No related merge requests found
...@@ -3850,6 +3850,7 @@ RTCP/Cobalt/GPUProc/src/SysInfoLogger.h -text ...@@ -3850,6 +3850,7 @@ RTCP/Cobalt/GPUProc/src/SysInfoLogger.h -text
RTCP/Cobalt/GPUProc/src/backward/CL/cl.hpp -text RTCP/Cobalt/GPUProc/src/backward/CL/cl.hpp -text
RTCP/Cobalt/GPUProc/src/cpu_utils.cc -text RTCP/Cobalt/GPUProc/src/cpu_utils.cc -text
RTCP/Cobalt/GPUProc/src/cpu_utils.h -text RTCP/Cobalt/GPUProc/src/cpu_utils.h -text
RTCP/Cobalt/GPUProc/src/scripts/CobaltControl.sh eol=lf
RTCP/Cobalt/GPUProc/src/scripts/apply_casacore_measures_data.sh eol=lf RTCP/Cobalt/GPUProc/src/scripts/apply_casacore_measures_data.sh eol=lf
RTCP/Cobalt/GPUProc/src/scripts/get_casacore_measures_data.sh eol=lf RTCP/Cobalt/GPUProc/src/scripts/get_casacore_measures_data.sh eol=lf
RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh -text RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh -text
......
...@@ -37,4 +37,5 @@ ...@@ -37,4 +37,5 @@
6::d:::BeamControl 6::d:::BeamControl
6::d:::TBBControl 6::d:::TBBControl
6::d:::PythonControl 6::d:::PythonControl
6::d:::CobaltControl
# #
...@@ -118,6 +118,7 @@ lofar_add_bin_program(station_stream Station/station_stream.cc) ...@@ -118,6 +118,7 @@ lofar_add_bin_program(station_stream Station/station_stream.cc)
# install the scripts for MAC and for auto-updating casacore measures tables # install the scripts for MAC and for auto-updating casacore measures tables
install(PROGRAMS install(PROGRAMS
scripts/CobaltControl.sh
scripts/runObservation.sh scripts/runObservation.sh
scripts/startBGL.sh scripts/startBGL.sh
scripts/stopBGL.sh scripts/stopBGL.sh
......
#!/bin/bash
#
# CobaltControl.sh is the interface for `swlevel' to see
# which observations are running, and to kill them if requested.
COMMAND=$1
function procname() {
# the basename of this script, without its extension
basename -- "$0" | sed 's/[.][^.]*$//g'
}
shopt -s nullglob
case $COMMAND in
start)
# no-op
;;
stop)
for PIDFILE in $LOFARROOT/var/run/*.pid
do
PID=`cat $PIDFILE`
echo "Softly killing rtcp(${PID})"
kill -15 $PID
done
;;
status)
SWLEVEL=$2
PIDS=""
OBSIDS=""
for PIDFILE in $LOFARROOT/var/run/*.pid
do
PIDS="$PIDS `cat $PIDFILE`"
OBSIDS="$OBSIDS `echo $PIDFILE | perl -ne '/rtcp-([0-9]+).pid/; print $1;'`"
done
if [ -z "$OBSIDS" ]
then
printf "%d : %-25s DOWN\n" "$SWLEVEL" "`procname`"
else
printf "%d : %-25s %s %s\n" "$SWLEVEL" "`procname`" "$PIDS" "[ObsID:$OBSIDS]"
fi
;;
*)
echo "usage: $0 {start|stop|status}"
;;
esac
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