Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
CDS
software
advLigoRTS
Commits
07f50eca
Commit
07f50eca
authored
4 years ago
by
Erik von Reis
Browse files
Options
Downloads
Patches
Plain Diff
rtcds changed to handle epics only models for start, stop and status.
parent
23580900
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!167
Epics only models
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
support/bin/rtcds.in
+63
-27
63 additions, 27 deletions
support/bin/rtcds.in
with
63 additions
and
27 deletions
support/bin/rtcds.in
+
63
−
27
View file @
07f50eca
...
...
@@ -48,6 +48,16 @@ umask 0002
##################################################
contains
()
{
local
x
=
$1
shift
[[
$@
=
~
(
^|[[:space:]]
)
$x
(
$|
[[
:space:]]
)
]]
&&
return
0
||
return
1
}
epics_only_model
()
{
contains
$1
$EPICS_ONLY_MODELS
&&
return
0
||
return
1
}
check_env
()
{
for
var
in
${
USER_VARS
[*]
}
;
do
if
[
!
"
${
!var
}
"
]
;
then
...
...
@@ -136,7 +146,12 @@ check_host_sys_enabled() {
check_host_sys_active
()
{
for
sys
;
do
check_unit_available
${
sys
}
if
!
systemctl is-active rts@
${
sys
}
.target
>
/dev/null
;
then
if
epics_only_model
${
sys
}
;
then
local
unit_name
=
rts-epics@
${
sys
}
else
local
unit_name
=
rts@
${
sys
}
.target
fi
if
!
systemctl is-active
$unit_name
>
/dev/null
;
then
log
"System '
${
sys
}
' is not active on this system'."
exit
4
fi
...
...
@@ -146,7 +161,12 @@ check_host_sys_active() {
check_host_sys_inactive
()
{
for
sys
;
do
check_unit_available
${
sys
}
if
systemctl is-active rts@
${
sys
}
.target
>
/dev/null
;
then
if
epics_only_model
${
sys
}
;
then
local
unit_name
=
rts-epics@
${
sys
}
else
local
unit_name
=
rts@
${
sys
}
.target
fi
if
systemctl is-active
$unit_name
>
/dev/null
;
then
log
"System '
$sys
' is already active on this system'."
exit
4
fi
...
...
@@ -186,7 +206,11 @@ install_world() {
start_sys
()
{
for
sys
;
do
log
"### starting
$sys
..."
sudo
systemctl start rts@
${
sys
}
.target
if
epics_only_model
$sys
;
then
sudo
systemctl start rts-epics@
${
sys
}
else
sudo
systemctl start rts@
${
sys
}
.target
fi
# pause needed to avoid timing glitch when user model started immediately after IOP
log
"... waiting for start of
${
sys
}
to complete"
sleep
15
...
...
@@ -198,7 +222,11 @@ stop_sys() {
for
sys
;
do
log
"### stopping
$sys
..."
#${SCRIPTD}/kill${sys}
sudo
systemctl stop rts@
${
sys
}
.target
if
epics_only_model
$sys
;
then
sudo
systemctl stop rts-epics@
${
sys
}
else
sudo
systemctl stop rts@
${
sys
}
.target
fi
done
}
...
...
@@ -226,24 +254,28 @@ _lsmod() {
local
allloaded
=
for
m
in
${
modules
[*]
}
;
do
md
=
$(
lsmod |
grep
"^
${
m
}
"
)
||
true
if
[
-z
"
$md
"
]
;
then
printf
"%-18s ***NOT LOADED***
\n
"
"
$m
"
allloaded
=
1
else
echo
"
$md
"
fi
md
=
$(
lsmod |
grep
"^
${
m
}
"
)
||
true
if
[
-z
"
$md
"
]
;
then
printf
"%-18s ***NOT LOADED***
\n
"
"
$m
"
allloaded
=
1
else
echo
"
$md
"
fi
done
if
[
"
$systems
"
]
;
then
echo
for
m
in
${
systems
[*]
}
;
do
md
=
$(
lsmod |
grep
"^
${
m
}
"
)
||
true
if
[
-z
"
$md
"
]
;
then
printf
"%-18s ***NOT LOADED***
\n
"
"
$m
"
allloaded
=
1
else
echo
"
$md
"
fi
if
epics_only_model
$m
;
then
test
0
else
md
=
$(
lsmod |
grep
"^
${
m
}
"
)
||
true
if
[
-z
"
$md
"
]
;
then
printf
"%-18s ***NOT LOADED***
\n
"
"
$m
"
allloaded
=
1
else
echo
"
$md
"
fi
fi
done
fi
if
[
"
$allloaded
"
]
;
then
...
...
@@ -267,18 +299,22 @@ systems_status() {
echo
"------------------------------------------------------"
for
sys
in
${
systems
[*]
}
;
do
printf
'%-15s'
$sys
printf
'%-15s
'
$sys
for
subsys
in
${
subsystems
[*]
}
;
do
local
subsysstatus
=
'OFF'
if
systemctl is-failed
"rts-
${
subsys
}
@
${
sys
}
"
>
/dev/null
;
then
subsysstatus
=
'FAILED'
systems_health
=
10
if
!
epics_only_model
$sys
||
[[
$subsys
==
'epics'
]]
;
then
if
systemctl is-failed
"rts-
${
subsys
}
@
${
sys
}
"
>
/dev/null
;
then
subsysstatus
=
'FAILED'
systems_health
=
10
else
if
systemctl is-active
"rts-
${
subsys
}
@
${
sys
}
"
>
/dev/null
;
then
subsysstatus
=
'ON'
else
systems_health
=
10
fi
fi
else
if
systemctl is-active
"rts-
${
subsys
}
@
${
sys
}
"
>
/dev/null
;
then
subsysstatus
=
'ON'
else
systems_health
=
10
fi
subsysstatus
=
'N/A'
fi
printf
'%-15s'
$subsysstatus
done
...
...
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