Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
patch-control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carmelo Pellegrino
patch-control
Commits
0061751e
Commit
0061751e
authored
9 years ago
by
Carmelo Pellegrino
Browse files
Options
Downloads
Patches
Plain Diff
clean-up implemented through trap on exit
parent
c0cf07e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patch-control.sh
+15
-3
15 additions, 3 deletions
patch-control.sh
with
15 additions
and
3 deletions
patch-control.sh
+
15
−
3
View file @
0061751e
...
...
@@ -24,6 +24,16 @@ function test_lock() {
fi
}
function
on_exit
()
{
if
[
"
${
LOCK_OWNER
}
"
==
"True"
]
;
then
rm_lock
fi
for
pid
in
${
PROCS
}
;
do
kill
-9
${
pid
}
done
}
function
createList
()
{
local
LIST
local
file
...
...
@@ -73,6 +83,9 @@ function get_run_number() {
test_lock
||
{
zenity
--error
--text
=
"There is another instance running of this program."
;
exit
1
;
}
put_lock
LOCK_OWNER
=
"True"
trap
on_exit EXIT
while
[
1
]
;
do
...
...
@@ -88,7 +101,6 @@ while [ 1 ]; do
if
[
-z
"
${
rs_file
}
"
]
;
then
zenity
--error
--text
=
"No Run Setup file selectet, aborting"
rm_lock
exit
-1
fi
...
...
@@ -125,6 +137,7 @@ run_number=`get_run_number`
daq_log_file
=
~/.km3_private/daq_
${
run_number
}
.log
JGetMessage
-H
localhost
-T
MSG
-d
3
>
${
daq_log_file
}
&
PROCS
=(
${
PROCS
}
$!
)
## impl: get the pid and add to the list of must_kill_at_the_exit
# Copy selected run setup file, changing the run number
...
...
@@ -134,6 +147,7 @@ run_start_time=`nowUTC`
# Launch the DM
dm_driver
${
run_duration
}
| mono DetectorControl.exe
--control
--reset
&
PROCS
=(
${
PROCS
}
$!
)
# Launch the DAQ
log
"Launching the DAQ with the following command line: daq.sh
${
run_number
}
${
run_start_time
}
${
run_duration
}
"
...
...
@@ -149,6 +163,4 @@ sleep ${run_duration}
zenity
--info
--text
=
"Run
${
run_number
}
finished!"
rm_lock
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment