Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
2fd4d4f4
Commit
2fd4d4f4
authored
Apr 25, 2008
by
Paul Winkler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes bug 143813: zopectl should exit non-zero if child processes fail.
parent
f4ecaa7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Zope2/Startup/zopectl.py
lib/python/Zope2/Startup/zopectl.py
+9
-3
No files found.
doc/CHANGES.txt
View file @
2fd4d4f4
...
...
@@ -8,6 +8,9 @@ Zope Changes
Bugs Fixed
- Launchpad #143813: zopectl now exits non-zero when
child processes fail.
- Products.Five: Resynced browser.adding with zope.app.container.
This fixes some minor bugs and removes deprecated code.
...
...
lib/python/Zope2/Startup/zopectl.py
View file @
2fd4d4f4
...
...
@@ -147,6 +147,8 @@ class ZopeCtlOptions(ZDOptions):
class
ZopeCmd
(
ZDCmd
):
_exitstatus
=
0
def
_get_override
(
self
,
opt
,
name
,
svalue
=
None
,
flag
=
0
):
# Suppress the config file, and pass all configuration via the
# command line. This avoids needing to specialize the zdrun
...
...
@@ -265,7 +267,7 @@ class ZopeCmd(ZDCmd):
cmd
+=
'[sys.argv.append(x) for x in %s];'
%
argv
cmd
+=
'import Zope2; app=Zope2.app(); execfile(
\
'
%s
\
'
)'
%
script
cmdline
=
self
.
get_startup_cmd
(
self
.
options
.
python
,
cmd
)
os
.
system
(
cmdline
)
self
.
_exitstatus
=
os
.
system
(
cmdline
)
def
help_run
(
self
):
print
"run <script> [args] -- run a Python script with the Zope "
...
...
@@ -335,10 +337,11 @@ class ZopeCmd(ZDCmd):
# Parent process running (execv replaces process in child
while
True
:
try
:
os
.
waitpid
(
pid
,
0
)
pid
,
status
=
os
.
waitpid
(
pid
,
0
)
except
(
OSError
,
KeyboardInterrupt
):
continue
else
:
self
.
_exitstatus
=
status
break
def
help_test
(
self
):
...
...
@@ -364,6 +367,8 @@ def main(args=None):
print
"program:"
,
" "
.
join
(
options
.
program
)
c
.
do_status
()
c
.
cmdloop
()
else
:
return
min
(
c
.
_exitstatus
,
1
)
def
_ignoreSIGCHLD
(
*
unused
):
while
1
:
...
...
@@ -393,4 +398,5 @@ if __name__ == "__main__":
# SIGCHILD is unset, just don't bother registering a SIGCHILD
# signal handler at all.
signal
.
signal
(
signal
.
SIGCHLD
,
_ignoreSIGCHLD
)
main
()
exitstatus
=
main
()
sys
.
exit
(
exitstatus
)
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