Zope 2.7.0 zopectl problems (bug?) and questions
I'm trying to find out how to use the zopectl script. My guess (in the absence of docs) would be that: ./zopectl start starts zope ./zopectl stop stops zope The start command gives me the following problem: MJMG5:~/devel/python/Zope/instance2/bin mjm$ ./zopectl 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 But Zope DOES start! This on a Mac G5 (OSX 10.3) and python 2.3. Also what do the 'daemon', 'backoff-limit' and 'forever' options do? When I use ./zopectl -f start and then ./zopectl -f show, I get 'forever': 0. How can I create an auto-restarting Zope, so that when Zope crashes it is automatically restarted? Finally how do I see (and distinguish) the Zope process in the ps listing (yes I'm coming from a Windows background ;-)? TIA M.J. Maré WebToTheMax
Apparently zopectl doesn't work properly under OS X or Solaris. Starting Zope under zopectl (if it worked properly) would cause it to auto-restart. You distinguise the Zope process in the ps listing by looking for a process that runs python. On Mon, 2004-02-16 at 08:03, Marcel Maré wrote:
I'm trying to find out how to use the zopectl script.
My guess (in the absence of docs) would be that:
./zopectl start starts zope ./zopectl stop stops zope
The start command gives me the following problem:
MJMG5:~/devel/python/Zope/instance2/bin mjm$ ./zopectl 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
But Zope DOES start! This on a Mac G5 (OSX 10.3) and python 2.3.
Also what do the 'daemon', 'backoff-limit' and 'forever' options do? When I use ./zopectl -f start and then ./zopectl -f show, I get 'forever': 0.
How can I create an auto-restarting Zope, so that when Zope crashes it is automatically restarted?
Finally how do I see (and distinguish) the Zope process in the ps listing (yes I'm coming from a Windows background ;-)?
TIA
M.J. Maré WebToTheMax
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Am 16.02.2004, 15:13 Uhr schrieb Chris McDonough <chrism@plope.com>: [...]
OSError: [Errno 10] No child processes [...] Apparently zopectl doesn't work properly under OS X or Solaris.
Same here with Linux 2.6.0 (Debian). Exactly the same traceback and Zope is up and running despite the traceback. I suspect the os.waitpid() or os.spawnvp() implementations of Python 2.3.3 since entering the strings given to spawnvp directly at shell level works fine. Regards, Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
That's the first time I've heard of problems under Linux. Unfortunately, the guy who wrote it quit Zope Corp and the folks left there will likely not have it on their radar to fix it until it bites them personally. So I suspect it's up to the folks that are having problems with it to diagnose the issue and supply a patch for 2.7.1. - C On Mon, 2004-02-16 at 09:49, Jo Meder wrote:
Am 16.02.2004, 15:13 Uhr schrieb Chris McDonough <chrism@plope.com>:
[...]
OSError: [Errno 10] No child processes [...] Apparently zopectl doesn't work properly under OS X or Solaris.
Same here with Linux 2.6.0 (Debian). Exactly the same traceback and Zope is up and running despite the traceback.
I suspect the os.waitpid() or os.spawnvp() implementations of Python 2.3.3 since entering the strings given to spawnvp directly at shell level works fine.
Regards,
Jo.
Am 16.02.2004, 16:31 Uhr schrieb Chris McDonough <chrism@plope.com>:
Unfortunately, the guy who wrote it quit Zope Corp and the folks left there will likely not have it on their radar to fix it until it bites them personally. So I suspect it's up to the folks that are having problems with it to diagnose the issue and supply a patch for 2.7.1.
Too bad. So, here we go (I'd very much appreciate some handholding here ;-) Can everybody have a look at the following snippet? This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback: if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args) IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not. So the patch would be to exchange these to lines to read if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args) With me so far? I'm going to give this some test on the complaining Linux-Box but any additional feedback and tests are welcome. If this works and my logic isn't flawed I'll submit a bugreport and patch to the collector. Regards Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
Boy, that seems to make sense, but who knows. I'm curious as to why zopectl backgrounding works at all under any UNIX (it has always worked for me under any Linux version I've tried), if this change is necessary. It seems to be too simple a bug to not be caught earlier on (not that I'd look a gift horse in the mouth.. but.. ;-) - C On Mon, 2004-02-16 at 10:54, Jo Meder wrote:
Am 16.02.2004, 16:31 Uhr schrieb Chris McDonough <chrism@plope.com>:
Unfortunately, the guy who wrote it quit Zope Corp and the folks left there will likely not have it on their radar to fix it until it bites them personally. So I suspect it's up to the folks that are having problems with it to diagnose the issue and supply a patch for 2.7.1.
Too bad. So, here we go (I'd very much appreciate some handholding here ;-)
Can everybody have a look at the following snippet?
This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback:
if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args)
IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not.
So the patch would be to exchange these to lines to read
if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args)
With me so far? I'm going to give this some test on the complaining Linux-Box but any additional feedback and tests are welcome.
If this works and my logic isn't flawed I'll submit a bugreport and patch to the collector.
Regards
Jo.
Am 16.02.2004, 21:08 Uhr schrub Chris McDonough <chrism@plope.com>:
I'm curious as to why zopectl backgrounding works at all under any UNIX (it has always worked for me under any Linux version I've tried), if this change is necessary.
For one there is no zdctl.py in Zope 2.6 and I have up to 2.6.3 always used my on zopectl-script. Also there seem to have been some changes to zdctl.py between 2.7b2 and 2.7rc2. I never tested b3 or rc1.
It seems to be too simple a bug to not be caught earlier on (not that I'd look a gift horse in the mouth.. but.. ;-)
Another reason might be that many init.d scripts use start-stop-daemon to handle daemonizing, perhaps some distributions choose to use that instead of zopectl. Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
On Mon, 2004-02-16 at 16:02, Jo Meder wrote:
Am 16.02.2004, 21:08 Uhr schrub Chris McDonough <chrism@plope.com>:
I'm curious as to why zopectl backgrounding works at all under any UNIX (it has always worked for me under any Linux version I've tried), if this change is necessary.
For one there is no zdctl.py in Zope 2.6 and I have up to 2.6.3 always used my on zopectl-script.
Right, I wasn't referring to anything but the zopectl that ships with 2.7.
Also there seem to have been some changes to zdctl.py between 2.7b2 and 2.7rc2. I never tested b3 or rc1.
OK.
It seems to be too simple a bug to not be caught earlier on (not that I'd look a gift horse in the mouth.. but.. ;-)
Another reason might be that many init.d scripts use start-stop-daemon to handle daemonizing, perhaps some distributions choose to use that instead of zopectl.
Well, I'm pretty sure I'm not mistaking zopectl for something else. I use it all the time. - C
On Monday 16 February 2004 23:54, Jo Meder wrote:
Am 16.02.2004, 16:31 Uhr
schrieb Chris McDonough <chrism@plope.com>:
Unfortunately, the guy who wrote it quit Zope Corp and the folks left there will likely not have it on their radar to fix it until it bites them personally. So I suspect it's up to the folks that are having problems with it to diagnose the issue and supply a patch for 2.7.1.
Too bad. So, here we go (I'd very much appreciate some handholding here ;-)
Can everybody have a look at the following snippet?
This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback:
if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args)
IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not.
So the patch would be to exchange these to lines to read
if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args)
With me so far? I'm going to give this some test on the complaining Linux-Box but any additional feedback and tests are welcome.
If this works and my logic isn't flawed I'll submit a bugreport and patch to the collector.
i;ve had good luck (it runs without any complaints) with original zopectl with rh/fedora based linux. just a fyi
Regards
Jo.
Am 17.02.2004, 02:16 Uhr schrub Bakhtiar A Hamid <kedai@kedai.com.my>:
i;ve had good luck (it runs without any complaints) with original zopectl with rh/fedora based linux.
What kernel version are you using? I switched from Zope 2.7b2 to 2.7rc2 at about the same time as from kernel 2.2.17 to 2.6.0 Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
I've never tried zopectl under Linux kernel 2.6... only under 2.4, actually. Wonder if that's the difference... maybe someone else with 2.6 kernel can try? On Tue, 2004-02-17 at 02:08, Jo Meder wrote:
Am 17.02.2004, 02:16 Uhr schrub Bakhtiar A Hamid <kedai@kedai.com.my>:
i;ve had good luck (it runs without any complaints) with original zopectl with rh/fedora based linux.
What kernel version are you using? I switched from Zope 2.7b2 to 2.7rc2 at about the same time as from kernel 2.2.17 to 2.6.0
Jo.
Am 17.02.2004, 15:21 Uhr schrub Chris McDonough <chrism@plope.com>:
I've never tried zopectl under Linux kernel 2.6... only under 2.4, actually. Wonder if that's the difference... maybe someone else with 2.6 kernel can try?
After temporarily installing a freshly compiled 2.4.24 kernel I can now confirm that kernel 2.4.24 is does indeed behave differently. The original (IMHO wrong) attribution of P_WAIT and P_NOWAIT do daemon and non-daemon mode respectively does not affect the 2.4.24 kernel. No traceback is generated. At the same time switching to P_NOWAIT for daemon mode and P_WAIT for non daemon mode works for 2.4.24 and for 2.6.0 kernels as well. This is a strong indication for me that this is the "right thing to do". Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
On Tuesday 17 February 2004 22:21, Chris McDonough wrote:
I've never tried zopectl under Linux kernel 2.6... only under 2.4, actually. Wonder if that's the difference... maybe someone else with 2.6 kernel can try?
zopectl b0rked with kernel 2.6 so, i guess the issue is real then ?
On Tue, 2004-02-17 at 02:08, Jo Meder wrote:
Am 17.02.2004, 02:16 Uhr
schrub Bakhtiar A Hamid <kedai@kedai.com.my>:
i;ve had good luck (it runs without any complaints) with original zopectl with rh/fedora based linux.
What kernel version are you using? I switched from Zope 2.7b2 to 2.7rc2 at about the same time as from kernel 2.2.17 to 2.6.0
Jo.
On Monday, February 16, 2004, at 07:54 AM, Jo Meder wrote:
Can everybody have a look at the following snippet?
This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback:
if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args)
IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not.
So the patch would be to exchange these to lines to read
if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args)
I can confirm that this change makes the zopectl script work as expected on Mac OS X 10.2.8. Thank you Jo!!! Can people with Linux 2.4 and 2.6 please test zopectl with the fix above? Jim -- Jim Roepcke Tyrell Software Corp <http://www.tyrell.com/>
On Tuesday, February 17, 2004, at 12:41 PM, Jim Roepcke wrote:
On Monday, February 16, 2004, at 07:54 AM, Jo Meder wrote:
Can everybody have a look at the following snippet?
This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback:
if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args)
IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not.
So the patch would be to exchange these to lines to read
if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args)
I can confirm that this change makes the zopectl script work as expected on Mac OS X 10.2.8.
Thank you Jo!!!
Can people with Linux 2.4 and 2.6 please test zopectl with the fix above?
I just tested this on a new python 2.3.3 and zope 2.7.0 build on debian with the 2.4 kernel and it worked fine. (it worked fine with or without the swapping of those two lines) Jim -- Jim Roepcke Tyrell Software Corp <http://www.tyrell.com/>
Indeed it now works flawlessly on OSX 10.3. Thanks for the quick fix. M.J. Maré WebToTheMax
On Monday, February 16, 2004, at 07:54 AM, Jo Meder wrote:
Can everybody have a look at the following snippet?
This is from zdctl.py function do_start, the code directly preceeding the spawnvp() the results in the traceback:
if self.options.daemon: flag = os.P_WAIT else: flag = os.P_NOWAIT os.spawnvp(flag, args[0], args)
IMHO the settings for flag are exactly the wrong way around. If self.options.daemon contains what the name suggests, we should us os.P_NOWAIT if we are in daemon-mode and os.P_WAIT if where not.
So the patch would be to exchange these to lines to read
if self.options.daemon: flag = os.P_NOWAIT else: flag = os.P_WAIT os.spawnvp(flag, args[0], args)
I can confirm that this change makes the zopectl script work as expected on Mac OS X 10.2.8.
Thank you Jo!!!
Can people with Linux 2.4 and 2.6 please test zopectl with the fix above?
Jim
-- Jim Roepcke Tyrell Software Corp <http://www.tyrell.com/>
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Am 18.02.2004, 21:19 Uhr schrob Marcel Maré <mjmare@webtothemax.com>:
Indeed it now works flawlessly on OSX 10.3.
A big "thank you" to everybody who helped by testing zopectl and my small patch on various systems. I've now filed a bug report and patch to the Zope collector (issue #1235, see http://zope.org/Collectors/Zope/1235 ) Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder-------------------fon: ++49-30-417 17 63 33 http://www.meder.de/ ------------------- fax: ++49-30-417 17 63 45 Kollwitzstr. 75 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
I've committed the patch. Thanks! On Wed, 2004-02-18 at 16:33, Jo Meder wrote:
Am 18.02.2004, 21:19 Uhr schrob Marcel Maré <mjmare@webtothemax.com>:
Indeed it now works flawlessly on OSX 10.3.
A big "thank you" to everybody who helped by testing zopectl and my small patch on various systems.
I've now filed a bug report and patch to the Zope collector (issue #1235, see http://zope.org/Collectors/Zope/1235 )
Jo.
Marcel Maré wrote at 2004-2-16 14:03 +0100:
I'm trying to find out how to use the zopectl script.
My guess (in the absence of docs) would be that:
./zopectl start starts zope ./zopectl stop stops zope
Yes. BTW, there are some docs in "zdaemon/component.xml".
The start command gives me the following problem:
MJMG5:~/devel/python/Zope/instance2/bin mjm$ ./zopectl start Traceback (most recent call last): ... 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 should not happen unless you have a SIGCHLD handler installed or "fork" or "waitpid" are broken.
But Zope DOES start! This on a Mac G5 (OSX 10.3) and python 2.3.
This would indicate a broken "waitpid" or "fork". Check the "pid" returned by "fork". It must be the pid of your Zope process. If it is, then "waitpid" is broken (otherwise "fork").
Also what do the 'daemon', 'backoff-limit' and 'forever' options do?
They are documented in "zdaemon/component.xml". -- Dieter
participants (7)
-
Bakhtiar A Hamid -
Chris McDonough -
Dieter Maurer -
Jamie Heilman -
Jim Roepcke -
Jo Meder -
Marcel Maré