Skip to content
Snippets Groups Projects

rtcds improvements

Merged Erik von Reis requested to merge erik.vonreis/advligorts:rtcds_improvements into master
Files
2
+ 45
5
@@ -51,6 +51,9 @@ USER_VARS=(SITE IFO RCG_LIB_PATH)
LIST_VARS=(RTS_VERSION ${USER_VARS[@]} RCG_SRC RCG_BUILD_ROOT RCG_BUILDD RCG_TARGET)
EXPORT_VARS=(${USER_VARS[@]} site ifo CDS_SRC CDS_IFO_SRC)
# time in seconds to wait before starting another model.
START_DELAY=${START_DELAY:-15}
# set the umask to ensure that all files and directories are made
# group writable
umask 0002
@@ -322,7 +325,7 @@ start_sys() {
# pause needed to avoid timing glitch when user model started immediately after IOP
log "... waiting for start of ${sys} to complete"
sleep 15
sleep $START_DELAY
log "${sys} started"
else
log "$sys can't be run on $(hostname)"
@@ -336,7 +339,21 @@ stop_sys() {
log "### stopping $sys..."
#${SCRIPTD}/kill${sys}
local unit_name=`get_model_unit ${sys}`
sudo systemctl stop $unit_name
sudo systemctl stop $unit_name
timeout=0
md=waiting
while [ -n "${md}" ]
do
sleep 1
md=$(lsmod | grep "^${sys}\s") || true
let "timeout=timeout+1"
if [ $timeout -ge 120 ]
then
log "Timed out waiting for ${sys} to stop"
exit 4
fi
done
done
}
@@ -354,6 +371,17 @@ disable_sys() {
done
}
check_case() {
for sys ; do
lcsys=$(echo $sys | tr '[:upper:]' '[:lower:]')
if [ "$lcsys" != "$sys" ]
then
log "*** Error: ${sys} has uppercase letters. Model names must not have uppercase letters."
exit 3
fi
done
}
_lsmod() {
local systems=($(list_host_sys))
local rts=(mbuf gpstime)
@@ -583,12 +611,17 @@ fi
case $cmd in
'build'|'make')
if [ "$EUID" -eq 0 ] ; then
log "*** Error: building as 'root' not allowed"
exit 2
fi
if [[ -n $ALL_FLAG ]] ; then
check_env
prep_buildd
build_world
elif [[ $1 ]] ; then
check_env
check_case $@
prep_buildd
build_sys $@
else
@@ -597,12 +630,17 @@ case $cmd in
fi
;;
'install')
if [ "$EUID" -eq 0 ] ; then
log "*** Error: Installing as 'root' not allowed"
exit 2
fi
if [[ -n $ALL_FLAG ]] ; then
check_env
prep_target
install_world
elif [[ $1 ]] ; then
check_env
check_case $@
prep_target
install_sys $@
else
@@ -614,7 +652,7 @@ case $cmd in
if [[ -n $ALL_FLAG ]] ; then
start_sys $(list_host_sys)
elif [[ $1 ]] ; then
check_host_sys_inactive $@
check_case $@
start_sys $@
else
log "You must specify at least one system to start (or '--all')."
@@ -627,7 +665,7 @@ case $cmd in
stop_sys $(list_host_sys | tac)
start_sys $(list_host_sys)
elif [[ $1 ]] ; then
check_host_sys_active $@
check_case $@
stop_sys $@
start_sys $@
else
@@ -640,7 +678,7 @@ case $cmd in
# we do this in reverse so the IOP is stopped last
stop_sys $(list_host_sys | tac)
elif [[ $1 ]] ; then
check_host_sys_active $@
check_case $@
stop_sys $@
else
log "You must specify at least one system to stop (or '--all')."
@@ -657,6 +695,7 @@ case $cmd in
# we do this in reverse so the IOP is stopped last
${cmd}_sys $(list_host_sys | tac)
elif [[ $1 ]] ; then
check_case $@
${cmd}_sys $@
else
log "You must specify at least one system to $cmd (or '--all')."
@@ -692,6 +731,7 @@ case $cmd in
log "You must specify system to view."
exit 2
fi
check_case $1
olog="${RCG_BUILDD}/${1}.log"
elog="${RCG_BUILDD}/${1}_error.log"
echo $olog
Loading