restart stream service when config file changed

This commit is contained in:
Dmitry Ozerov
2020-12-06 10:05:43 +01:00
committed by Data Backend account
parent e68a77ce8b
commit 13218459bc
11 changed files with 75 additions and 12 deletions
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="24"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF01.json
SERVICE=JF01-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF01.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+8 -3
View File
@@ -4,14 +4,19 @@ H=`echo ${HOSTNAME} | sed 's/.psi.ch//'`
case ${H} in
'sf-daq-4')
coreAssociated="33,34,35"
config=/gpfs/photonics/swissfel/buffer/config/stream-JF02.json
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF02.daq4.json
;;
'sf-daq-8')
coreAssociated="20,21"
config=/gpfs/photonics/swissfel/buffer/config/stream-JF02.daq8.json
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF02.json
;;
*)
coreAssociated="12"
esac
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${config}
SERVICE=JF02-stream
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="27"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF04.json
SERVICE=JF04-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF04.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="22,23,24"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF06.json
SERVICE=JF06-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF06.daq8.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+6 -1
View File
@@ -1,5 +1,10 @@
#!/bin/bash
coreAssociated="20,21"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF06_4M.daq8.json
SERVICE=JF06_4M-stream
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF06_4M.daq8.json
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="20,21,22,23"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF07.json
SERVICE=JF07-stream
taskset -c ${coreAssociated} /usr/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF07.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="25"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF09.json
SERVICE=JF09-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF09.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="26"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF10.json
SERVICE=JF10-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF10.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="14,15,16"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF11.json
SERVICE=JF11-stream
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF11.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+5 -1
View File
@@ -1,5 +1,9 @@
#!/bin/bash
coreAssociated="25"
CONFIG=/gpfs/photonics/swissfel/buffer/config/stream-JF13.json
SERVICE=JF13-stream
taskset -c ${coreAssociated} /usr/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF13.json
/home/dbe/git/sf_daq_buffer/scripts/check_config_changed.sh ${CONFIG} ${SERVICE} &
taskset -c ${coreAssociated} /usr/local/bin/sf_stream ${CONFIG}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
F=$1
S=$2
t=`stat -c %y $F`
while true
do
sleep 5
t1=`stat -c %y $F`
if [ "${t1}" != "${t}" ]
then
echo $F changed
t=${t1}
systemctl restart ${S}
fi
done