Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
76f2188a
Commit
76f2188a
authored
Sep 29, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor bootstrap: write pid too file while processing
parent
238b167d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
slapos/monitor/monitor.py
slapos/monitor/monitor.py
+6
-0
No files found.
slapos/monitor/monitor.py
View file @
76f2188a
...
...
@@ -91,6 +91,7 @@ class Monitoring(object):
self
.
parameter_list
=
[
param
.
strip
()
for
param
in
config
.
get
(
"monitor"
,
"parameter-list"
).
split
(
'
\
n
'
)
if
param
]
# Use this file to write knowledge0_cfg required by webrunner
self
.
parameter_cfg_file
=
config
.
get
(
"monitor"
,
"parameter-file-path"
).
strip
()
self
.
pid_file
=
config
.
get
(
"monitor"
,
"pid-file"
)
self
.
config_folder
=
os
.
path
.
join
(
self
.
private_folder
,
'config'
)
self
.
report_folder
=
self
.
private_folder
...
...
@@ -208,6 +209,7 @@ class Monitoring(object):
response
=
urllib2
.
urlopen
(
url
)
except
urllib2
.
HTTPError
:
self
.
bootstrap_is_ok
=
False
print
"Error: Failed to get Monitor configuration at %s "
%
monitor_url
return
'Unknown Instance'
else
:
try
:
...
...
@@ -442,6 +444,10 @@ class Monitoring(object):
if
os
.
path
.
exists
(
self
.
promise_output_file
):
os
.
unlink
(
self
.
promise_output_file
)
# save pid of current process into file
with
open
(
self
.
pid_file
,
'w'
)
as
pid_file
:
pid_file
.
write
(
str
(
os
.
getpid
()))
# create symlinks from monitor.conf
self
.
createSymlinksFromConfig
(
self
.
public_folder
,
self
.
public_path_list
)
self
.
createSymlinksFromConfig
(
self
.
private_folder
,
self
.
private_path_list
)
...
...
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