diff --git a/scripts/JF01-stream.sh b/scripts/JF01-stream.sh index 85ed846..6341508 100644 --- a/scripts/JF01-stream.sh +++ b/scripts/JF01-stream.sh @@ -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} diff --git a/scripts/JF02-stream.sh b/scripts/JF02-stream.sh index 2ee361f..7912e94 100644 --- a/scripts/JF02-stream.sh +++ b/scripts/JF02-stream.sh @@ -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} + diff --git a/scripts/JF04-stream.sh b/scripts/JF04-stream.sh index 307df8f..e8690d2 100644 --- a/scripts/JF04-stream.sh +++ b/scripts/JF04-stream.sh @@ -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} diff --git a/scripts/JF06-stream.sh b/scripts/JF06-stream.sh index 28a48db..03d6adf 100644 --- a/scripts/JF06-stream.sh +++ b/scripts/JF06-stream.sh @@ -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} diff --git a/scripts/JF06_4M-stream.sh b/scripts/JF06_4M-stream.sh index 44c5f49..7896ef8 100644 --- a/scripts/JF06_4M-stream.sh +++ b/scripts/JF06_4M-stream.sh @@ -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 diff --git a/scripts/JF07-stream.sh b/scripts/JF07-stream.sh index bcaf1d4..48a0e6b 100644 --- a/scripts/JF07-stream.sh +++ b/scripts/JF07-stream.sh @@ -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} diff --git a/scripts/JF09-stream.sh b/scripts/JF09-stream.sh index e1c239b..d05d2be 100644 --- a/scripts/JF09-stream.sh +++ b/scripts/JF09-stream.sh @@ -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} diff --git a/scripts/JF10-stream.sh b/scripts/JF10-stream.sh index d204c45..b73b2df 100644 --- a/scripts/JF10-stream.sh +++ b/scripts/JF10-stream.sh @@ -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} diff --git a/scripts/JF11-stream.sh b/scripts/JF11-stream.sh index e5fb95f..93db1d6 100644 --- a/scripts/JF11-stream.sh +++ b/scripts/JF11-stream.sh @@ -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} diff --git a/scripts/JF13-stream.sh b/scripts/JF13-stream.sh index 3b8e226..4489505 100644 --- a/scripts/JF13-stream.sh +++ b/scripts/JF13-stream.sh @@ -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} diff --git a/scripts/check_config_changed.sh b/scripts/check_config_changed.sh new file mode 100755 index 0000000..bf6b0fe --- /dev/null +++ b/scripts/check_config_changed.sh @@ -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 +