Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
d3ff692d
Commit
d3ff692d
authored
Dec 11, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't trust argv when deciding if duplicate.
parent
0a5071e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
slapos/grid/utils.py
slapos/grid/utils.py
+4
-7
No files found.
slapos/grid/utils.py
View file @
d3ff692d
...
...
@@ -144,13 +144,10 @@ def setRunning(pid_file):
pid
=
None
# XXX This could use psutil library.
if
pid
is
not
None
and
os
.
path
.
exists
(
"/proc/%s"
%
pid
):
#XXX: can we trust sys.argv?
process_name
=
os
.
path
.
basename
(
sys
.
argv
[
0
])
if
process_name
in
open
(
'/proc/%s/cmdline'
%
pid
,
'r'
).
readline
():
# In case process is present, ignore.
logger
.
warning
(
'New slapos process started, but another slapgrid '
'process is aleady running with pid %s, exiting.'
%
pid
)
sys
.
exit
(
10
)
# In case process is present, ignore.
logger
.
warning
(
'New slapos process started, but another slapgrid '
'process is aleady running with pid %s, exiting.'
%
pid
)
sys
.
exit
(
10
)
logger
.
info
(
'Existing pid file %r was stale one, overwritten'
%
pid_file
)
# Start new process
write_pid
(
pid_file
)
...
...
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