Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
a
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Yusei Tahara
a
Commits
95a2a43e
Commit
95a2a43e
authored
Jan 18, 2024
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix slapos-theia.
parent
f965e32c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
slapos-theia
slapos-theia
+17
-3
No files found.
slapos-theia
View file @
95a2a43e
...
...
@@ -11,11 +11,16 @@ OCF_NOT_RUNNING = 7
action
=
sys
.
argv
[
1
]
instance_root
=
os
.
getenv
(
'OCF_RESKEY_instance_root'
)
or
''
instance_root_b
=
instance_root
.
encode
(
'utf8'
)
part_id
=
os
.
getenv
(
'OCF_RESKEY_part_id'
)
slappart
=
'slappart%s'
%
part_id
slappart_b
=
slappart
.
encode
(
'utf8'
)
slapuser
=
'slapuser%s'
%
part_id
service_list
=
os
.
getenv
(
'OCF_RESKEY_services'
,
''
).
split
(
','
)
service_list
=
[]
services_text
=
os
.
getenv
(
'OCF_RESKEY_services'
,
None
)
if
services_text
:
service_list
=
services_text
.
split
(
','
)
#kumofs_gateway,kumofs_manager,kumofs_server,mariadb,zeo,zope,haproxy
...
...
@@ -46,12 +51,12 @@ def isTheiaStopped():
def
runSlapOSInTheia
(
*
args
):
return
runCommand
(
'sudo'
,
'-u'
,
slapuser
,
'
/srv/slapgrid/%s/srv/runner/bin/slapos'
%
slappart
,
'
%s/%s/srv/runner/bin/slapos'
%
(
instance_root
,
slappart
)
,
*
args
)
def
checkAppStatus
(
target_status
):
completed_process
=
runSlapOSInTheia
(
'node'
)
if
completed_process
.
stdout
==
b'unix://
/srv/slapgrid/%s/srv/runner/instance/sv.sock no such file
\
n
'
%
slappart_b
:
if
completed_process
.
stdout
==
b'unix://
%s/%s/srv/runner/instance/sv.sock no such file
\
n
'
%
(
instance_root_b
,
slappart_b
)
:
if
target_status
==
'STOPPED'
:
return
True
else
:
...
...
@@ -87,6 +92,8 @@ def isAppStopped():
def
monitor
():
result
=
OCF_ERR_GENERIC
if
not
os
.
path
.
exists
(
instance_root
):
result
=
OCF_NOT_RUNNING
try
:
if
isTheiaRunning
()
and
isAppRunning
():
result
=
OCF_SUCCESS
...
...
@@ -136,6 +143,13 @@ This is the resource agent for SlapOS Theia.
<shortdesc lang="en">Manages SlapOS Theia instance</shortdesc>
<parameters>
<parameter name="instance_root" unique="0" required="1">
<longdesc>
Instance Root Directory Path
</longdesc>
<shortdesc>Instance Root</shortdesc>
<content type="string"/>
</parameter>
<parameter name="part_id" unique="1" required="1">
<longdesc>
Computer Partition ID, slappartX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment