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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.toolbox
Commits
1411af8e
Commit
1411af8e
authored
Oct 17, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple utility to kill pid stored in files.
parent
96ffb553
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
setup.py
setup.py
+1
-0
slapos/systool.py
slapos/systool.py
+13
-0
No files found.
setup.py
View file @
1411af8e
...
...
@@ -49,6 +49,7 @@ setup(name=name,
'slapmonitor = slapos.monitor:run_slapmonitor'
,
'slapreport = slapos.monitor:run_slapreport'
,
'slaprunner = slapos.runner:run'
,
'killpidfromfile = slapos.systool:killpidfromfile'
,
]
},
)
slapos/systool.py
0 → 100644
View file @
1411af8e
import
sys
import
os
import
signal
def
killpidfromfile
():
if
len
(
sys
.
argv
)
!=
3
:
raise
ValueError
(
'Invocation: %s <pidfile> <signal name>'
%
sys
.
argv
[
0
])
file
=
sys
.
argv
[
1
]
sig
=
getattr
(
signal
,
sys
.
argv
[
2
],
None
)
if
sig
is
None
:
raise
ValueError
(
'Unknwon signal name %s'
%
sys
.
argv
[
2
])
pid
=
int
(
open
(
file
).
read
())
print
'Killing pid %s with signal %s'
%
(
pid
,
sys
.
argv
[
2
])
os
.
kill
(
pid
,
sig
)
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