Hi,
I have been fighting with trying to get the TurboGears (CherryPy) web
server to start automatically after a computer restart and have been
unable to cure an error which seems to be associated with logging. I
enclose the shell script which is run on startup. Immediately below.
The messages are supposed to go to nohup.out in the same directory as
the application. The su nigelk -c was to create the process in my name
but does not seem to make any difference. Running this script outside
the startup sequence seems to work perfectly.
===================
#!/bin/sh
##
# Start FamilyTree server
##
echo "FamilyTree started"
. /etc/rc.common
ConsoleMessage "Starting FamilyTree server on port 8088"
cd /Users/nigelk/Documents/PythonScripts/turbogears/trunk/FamilyTree
su nigelk -c '/usr/bin/nohup /sw/bin/python FamilyTree-start.py' &
===================
The server returns the following message in the browser which seems to
be saying that it can't send the log messages anywhere. I use tracd
which is another python web server for project control and that starts
using an almost identical process ok.
===================
Unrecoverable error in the server.
=====First Error=====
Traceback (most recent call last):
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cphttptools.py", line 271, in run
main()
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cphttptools.py", line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
File
"/sw/lib/python2.4/site-packages/TurboGears-0.8a6-py2.4.egg/turbogears/
controllers.py", line 125, in newfunc
return controllers._process_output(tg_format, output, html)
File
"/sw/lib/python2.4/site-packages/TurboGears-0.8a6-py2.4.egg/turbogears/
controllers.py", line 38, in _process_output
output = view.render(output, tg_format, template=template)
File
"/sw/lib/python2.4/site-packages/TurboGears-0.8a6-py2.4.egg/turbogears/
view.py", line 93, in render
tclass = lookupTemplate(template)
File
"/sw/lib/python2.4/site-packages/TurboGears-0.8a6-py2.4.egg/turbogears/
view.py", line 51, in lookupTemplate
log.debug("Recompiling template for %s" % classname)
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 918, in debug
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 1039, in _log
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 1049, in handle
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 1082, in callHandlers
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 617, in handle
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 717, in emit
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/logging/
__init__.py", line 668, in handleError
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/
traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File
"/sw/src/fink.build/root-python24-2.4.1-1/sw/lib/python2.4/
traceback.py", line 13, in _print
file.write(str+terminator)
IOError: [Errno 5] Input/output error
=====Second Error=====
Traceback (most recent call last):
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cphttptools.py", line 428, in handleError
_cputil.getSpecialAttribute('_cpOnError')()
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cputil.py", line 235, in _cpOnError
cherrypy.HTTPError(500).set_response()
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cperror.py", line 188, in set_response
cherrypy.log(tb)
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
__init__.py", line 125, in log
logfunc(msg, context, severity)
File
"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/
_cputil.py", line 143, in _cpLogMessage
print s
IOError: [Errno 5] Input/output error
====================
I am rather stumped by this, please can somebody shed some light on my
error.
Thanks
Nigel King