Skip to content
Snippets Groups Projects
Commit a5637780 authored by Erik von Reis's avatar Erik von Reis
Browse files

rtcds: add check of system to see if model is assigned to it

parent 7c043f9a
No related branches found
No related tags found
1 merge request!195Rtcds check model
......@@ -26,6 +26,7 @@ site=${SITE,,*}
IFO=${IFO^^*}
ifo=${IFO,,*}
CHECK_MODEL_IN_HOST=${CHECK_MODEL_IN_HOST:-false}
IS_DOLPHIN_NODE=${IS_DOLPHIN_NODE:-false}
DAQ_STREAMING=${DAQ_STREAMING:-false}
......@@ -144,6 +145,17 @@ list_host_sys() {
fi
}
# returns 0 if $1 names a system that's designated to run
# on this host
check_sys_in_host() {
echo "CHECK_MODEL_IN_HOST=$CHECK_MODEL_IN_HOST"
echo "force_start=$force_start"
if $CHECK_MODEL_IN_HOST && ! $force_start ; then
local systems=`list_host_sys`
contains $1 $systems
fi
}
check_unit_available() {
if ! systemctl cat rts@$1.target > /dev/null ; then
log "RTS front end systemd units don't seem to be available. Is the advligorts-fe package installed?"
......@@ -216,13 +228,18 @@ install_world() {
start_sys() {
for sys ; do
log "### starting $sys..."
local unit_name=`get_model_unit ${sys}`
sudo systemctl start $unit_name
# pause needed to avoid timing glitch when user model started immediately after IOP
log "... waiting for start of ${sys} to complete"
sleep 15
log "${sys} started"
if check_sys_in_host $sys ; then
local unit_name=`get_model_unit ${sys}`
sudo systemctl start $unit_name
# pause needed to avoid timing glitch when user model started immediately after IOP
log "... waiting for start of ${sys} to complete"
sleep 15
log "${sys} started"
else
log "$sys can't be run on $(hostname)"
log "Override with the '--force-start' option."
fi
done
}
......@@ -425,6 +442,7 @@ Available commands:
${enable_usage}disable <sys>...|--all disable system start at boot
start <sys>...|--all start systems
--force-start start a model even if it fails some checks
restart <sys>...|--all restart running systems
stop|kill <sys>...|--all stop running systems
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment