[ZCM] [ZC] 1235/ 2 Resolve "zopectl dumps traceback on MacOS X 10.3, Solaris, Linux 2.6 kernels"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed Feb 18 16:49:59 EST 2004


Issue #1235 Update (Resolve) "zopectl dumps traceback on MacOS X 10.3, Solaris, Linux 2.6 kernels"
 Status Resolved, Zope/bug+solution low
To followup, visit:
  http://zope.org/Collectors/Zope/1235

==============================================================
= Resolve - Entry #2 by mcdonc on Feb 18, 2004 4:49 pm

 Status: Pending => Resolved

Thanks for the fix!  It has been checked in to the HEAD and the 2.7 branch and the next 2.7 release (2.7.1) will include it.
________________________________________
= Request - Entry #1 by jadibd on Feb 18, 2004 4:28 pm


Uploaded:  "zdctl.diff"
 - http://zope.org/Collectors/Zope/1235/zdctl.diff/view
zopectl reliably dumps a traceback when used to start in daemon mode ("zopectl -d start"):

> Traceback (most recent call last):
> File "/Users/mjm/devel/python/Zope-2.7.0/lib/python/Zope/Startup/zopectl.py",
> line 207, in ?
>     main()
> File "/Users/mjm/devel/python/Zope-2.7.0/lib/python/Zope/Startup/zopectl.py",
> line 190, in main
>     c.onecmd(" ".join(options.args))
> File 
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/cmd.py", > line 210, in onecmd
>     return func(arg)
> File "/Users/mjm/devel/python/Zope-2.7.0/lib/python/Zope/Startup/zopectl.py", 
> line 134, in do_start
>     ZDCmd.do_start(self, arg)
> File "/Users/mjm/devel/python/Zope-2.7.0/lib/python/zdaemon/zdctl.py",
> line 214, in do_start
>     os.spawnvp(flag, args[0], args)
> File 
> /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/os.py", 
> line 543, in spawnvp
>     return _spawnvef(mode, file, args, None, execvp)
> File 
> "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/os.py", > line 504, in _spawnvef
>     wpid, sts = waitpid(pid, 0)
> OSError: [Errno 10] No child processes

This is, because the spawnvp flags P_WAIT and P_NOWAIT in zdctl.py, function do_start() are used exactly the wrong way. 

P_NOWAIT should be used for a daemon process that is not expected to return and P_WAIT for a normal process, that doesn't detach itself.

See discussion on zope at zope.org in the thread starting at http://mail.zope.org/pipermail/zope/2004-February/147012.html and the attached diff file. 

This patch was tested to work with Solaris (unspecified version), MacOS X 10.3, Linux 2.4.24 and Linux 2.6.0, so I'm rather confident, that swapping P_WAIT and P_NOWAIT usage does not have any adverse effects on existing installations.


==============================================================




More information about the Zope-Collector-Monitor mailing list