diff --git a/.gitattributes b/.gitattributes index 9b1a2c2b47a3a993ad6b58e6af3514cc6baecc7f..b774469a1dce3452a39f29cdab85ae9043cd718a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4640,6 +4640,7 @@ RTCP/Cobalt/GPUProc/test/t_generate_globalfs_locations.in_parset -text RTCP/Cobalt/GPUProc/test/t_generate_globalfs_locations.sh eol=lf RTCP/Cobalt/InputProc/doc/Cobalt-New-InputSection.jpg -text svneol=unset#image/jpeg RTCP/Cobalt/InputProc/src/Delays/printDelays.log_prop -text +RTCP/Cobalt/InputProc/src/ping_intl.sh -text RTCP/Cobalt/InputProc/test/tMPI.run eol=lf RTCP/Cobalt/InputProc/test/tMPI.sh eol=lf RTCP/Cobalt/InputProc/test/tMPIUtil2.run eol=lf @@ -5543,6 +5544,7 @@ SubSystems/Online_Cobalt/install/install_casacore.sh eol=lf SubSystems/Online_Cobalt/install/install_qpid.sh eol=lf SubSystems/Online_Cobalt/install/lofarsys/bash_profile -text SubSystems/Online_Cobalt/install/lofarsys/bashrc -text +SubSystems/Online_Cobalt/install/lofarsys/crontab -text SubSystems/Online_Cobalt/install/postinstall.sh eol=lf SubSystems/Online_Cobalt/install/postinstall_lofarbuild.sh eol=lf SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh eol=lf diff --git a/RTCP/Cobalt/InputProc/src/CMakeLists.txt b/RTCP/Cobalt/InputProc/src/CMakeLists.txt index bcbe83a534ec8509b3e71ef12f59a920224d7dc7..ff6c208a3ad0e02414dbff6d22f46c4d7f44b093 100644 --- a/RTCP/Cobalt/InputProc/src/CMakeLists.txt +++ b/RTCP/Cobalt/InputProc/src/CMakeLists.txt @@ -49,3 +49,4 @@ configure_file( ${CMAKE_BINARY_DIR}/bin/mpirun.sh @ONLY) lofar_add_bin_scripts(${CMAKE_BINARY_DIR}/bin/mpirun.sh) +lofar_add_bin_scripts(ping_intl.sh) diff --git a/RTCP/Cobalt/InputProc/src/ping_intl.sh b/RTCP/Cobalt/InputProc/src/ping_intl.sh new file mode 100755 index 0000000000000000000000000000000000000000..7634f03c8b459308826e48464c8f14af2090612e --- /dev/null +++ b/RTCP/Cobalt/InputProc/src/ping_intl.sh @@ -0,0 +1,32 @@ +#!/bin/bash -u +echo "Begin `date`" +echo "Host `hostname`" + +HOSTNAME=`hostname` +RSPCONNECTIONS=$LOFARROOT/etc/StaticMetaData/RSPConnections_Cobalt.dat + +# International stations have the name xx6xx. +# +# For each International Station VLAN, Cobalt has IP 10.x.x.50, +# and we need to ping 10.x.x.1. +SRCIPS=` + <$RSPCONNECTIONS fgrep $HOSTNAME | + grep -v "^#" | + perl -ne ' + if (/^..60?(..?) .* 10[.]([0-9]+)[.]([0-9]+)[.]1../) { + if ($3 == 1) { + print "10.$2.$1.1\n" + } else { + print "10.$2.$3.1\n" + } + } ' + +echo "IPs $SRCIPS" + +for IP in $SRCIPS +do + # Ping this RSP board, but don't wait for an answer + ping -p 10fa -q -n -c 1 -w 1 $IP +done + +echo "End `date`" diff --git a/SubSystems/Online_Cobalt/install/lofarsys/crontab b/SubSystems/Online_Cobalt/install/lofarsys/crontab new file mode 100644 index 0000000000000000000000000000000000000000..6bfa90d6e7043152f7e43ccfe00f5d41f25c8b48 --- /dev/null +++ b/SubSystems/Online_Cobalt/install/lofarsys/crontab @@ -0,0 +1,3 @@ +# m h dom mon dow command +* * * * * source /opt/lofar/lofarinit.sh && ping_intl.sh >> $HOME/ping_intl.`hostname`.log 2>&1 + diff --git a/SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh b/SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh index c91db6aeb7218f98467d5d8ed134390207c783ee..21f9e857155fdcb23f62fee6148410cfaddd5681 100755 --- a/SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh +++ b/SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh @@ -31,3 +31,9 @@ ssh localhost true # ******************************************** echo "Configuring /opt/lofar/var..." mkdir -p ~lofarsys/lofar/var/{log,run} + +# ******************************************** +# Schedule periodic tasks +# ******************************************** +echo "Configuring crontab..." +crontab lofarsys/crontab