[Zope] RE:SOLVED: Why my Zope kept dying
Mike Renfro
renfro@tntech.edu
Thu, 7 Mar 2002 09:49:56 -0600
On Thu, Mar 07, 2002 at 09:13:23AM +0100, Ria Marinussen wrote:
> When you want to start zope in Debug mode, but want to be able to
> close a window, you should make sure the Zope proces is pushed to
> the background, like this:
> prompt>./start & <enter>
I think this needs a bit of clarification (*nix-specific details here,
may or may not apply to your exact system, but this experience was
with Linux):
Ways to start Zope:
- From a startup script (in /etc/init.d, /etc/rc.local, wherever)
during the usual system startup.
- From the same or similar startup script or command after system
startup. For example, when you upgrade versions of Zope and don't
reboot the system afterwards, or when you restart it with debugging
enabled.
One common way to make Zope crash or otherwise flake out (most common
symptom I've seen is nonfatal IOError exceptions) is to have bare
print statements in the Python code for debugging purposes. Those bare
prints end up going to the controlling terminal's standard output.
For a Zope started by method 1 above, bare prints will never crash
it. For a Zope started by method 2, bare prints *will* start crashing
or otherwise flaking Zope randomly once you've closed the controlling
terminal. Backgrounding the Zope start command with a simple '&' at
the end of the line will *not* help matters.
Two safe solutions:
- Redirect *all* standard output and standard error text into a file,
or into /dev/null -- something line './start 2>&1 > /somefile &'
- Run your Zope script inside a 'screen' session. See
http://www.linuxgazette.com/issue32/tag_detach.html for some details
on this program.
--
Mike Renfro / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- renfro@tntech.edu