From a1664e9a5ad6cdc75ce39a35f36dafda89be7749 Mon Sep 17 00:00:00 2001 From: Carmelo Pellegrino <carmelo.pellegrino@gmail.com> Date: Thu, 14 May 2015 18:08:44 +0200 Subject: [PATCH] lock related functions implemented using the logger to log the start of the TriDAS put the final question in background report the end of the run --- rsselector.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/rsselector.sh b/rsselector.sh index 72e4fe7..c6ba09f 100644 --- a/rsselector.sh +++ b/rsselector.sh @@ -7,6 +7,18 @@ # Author: Carmelo Pellegrino <carmelo.pellegrino@bo.infn.it> # +function put_lock() { + touch /tmp/auto_ss +} + +function rm_lock() { + unlink /tmp/auto_ss +} + +function test_lock() { + return [ -e /tmp/auto_ss ] +} + function createList() { local LIST local file @@ -105,6 +117,7 @@ JGetMessage -H localhost -T MSG -d 3 >${daq_log_file} & ## impl: get the pid and add to the list of must_kill_at_the_exit # Copy selected run setup file, changing the run number +cat ${rs_file} | sed -e 's/RUNNUMBER/${run_number}/' >dm.detectorfile run_start_time=`nowUTC` @@ -112,10 +125,17 @@ run_start_time=`nowUTC` dm_driver ${run_duration} | mono DetectorControl.exe --control --reset & # Launch the DAQ +log "Launching the DAQ with the following command line: daq.sh ${run_number} ${run_start_time} ${run_duration}" daq.sh ${run_number} ${run_start_time} ${run_duration} # Point the browser to the correct address, if required zenity --question \ --text="Would you like to open the DetectorManager GUI?" \ - --cancel-label="No, thanks" && firefox http://localhost:1301/ + --cancel-label="No, thanks" && firefox http://localhost:1301/ & + +# Wait the end of the run +sleep ${run_duration} + +zenity --info --text="Run ${run_number} finished!" +exit 0 -- GitLab