Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Lorenzo Martinico
slapos
Commits
36fe9c84
Commit
36fe9c84
authored
Oct 17, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use killpidfromfile from software.
Thanks to this instantiation is more self documented.
parent
59e45e66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
28 deletions
+1
-28
slapos/recipe/generic_zope/__init__.py
slapos/recipe/generic_zope/__init__.py
+0
-11
slapos/recipe/generic_zope/killpidfromfile.py
slapos/recipe/generic_zope/killpidfromfile.py
+0
-16
software/erp5/instance-zope.cfg
software/erp5/instance-zope.cfg
+1
-1
No files found.
slapos/recipe/generic_zope/__init__.py
View file @
36fe9c84
...
...
@@ -52,17 +52,6 @@ class Recipe(GenericBaseRecipe):
zope_config
[
'z2_log'
]
=
self
.
options
[
'z2-log'
]
zope_config
[
'pid-filename'
]
=
self
.
options
[
'pid-file'
]
zope_config
[
'lock-filename'
]
=
self
.
options
[
'lock-file'
]
# XXX: !!killpidfromfile shall be binary provided by software!!
killpidfromfile
=
self
.
createPythonScript
(
'killpidfromfile'
,
__name__
+
'.killpidfromfile'
)
path_list
.
append
(
killpidfromfile
)
post_rotate
=
self
.
createPythonScript
(
self
.
options
[
'logrotate-post'
],
__name__
+
'.killpidfromfile'
,
[
zope_config
[
'pid-filename'
],
'SIGUSR2'
]
)
path_list
.
append
(
post_rotate
)
prefixed_products
=
[]
for
product
in
reversed
(
zope_config
[
'products'
].
split
()):
product
=
product
.
strip
()
...
...
slapos/recipe/generic_zope/killpidfromfile.py
deleted
100644 → 0
View file @
59e45e66
import
sys
import
os
import
signal
def
killpidfromfile
(
*
args
):
if
len
(
args
):
file
=
args
[
1
]
sig
=
getattr
(
signal
,
args
[
2
],
None
)
else
:
file
=
sys
.
argv
[
1
]
sig
=
getattr
(
signal
,
sys
.
argv
[
2
],
None
)
if
sig
is
None
:
raise
ValueError
(
'Unknwon signal name %s'
%
sig
)
if
os
.
path
.
exists
(
file
):
pid
=
int
(
open
(
file
).
read
())
print
'Killing pid %s with signal %s'
%
(
pid
,
sig
)
os
.
kill
(
pid
,
sig
)
software/erp5/instance-zope.cfg
View file @
36fe9c84
...
...
@@ -68,7 +68,7 @@ name = zope
log = $${zope:event-log} $${zope:z2-log}
frequency = daily
rotate-num = 30
post = $
${zope:logrotate-post}
post = $
{buildout:bin-directory}/killpidfromfile $${zope:pid-file} SIGUSR2
sharedscripts = true
notifempty = true
create = true
...
...
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