Deploying CherryPy (daemon)

Viewed 13456

I've followed the basic CherryPy tutorial (http://www.cherrypy.org/wiki/CherryPyTutorial). One thing not discussed is deployment.

How can I launch a CherryPy app as a daemon and "forget about it"? What happens if the server reboots?

Is there a standard recipe? Maybe something that will create a service script (/etc/init.d/cherrypy...)

Thanks!

4 Answers

Info on Daemonizer options

When using Daemonizer, the docs don't state the options, e.g. how to redirect stdout or stderr. From the source of the Daemonizer class you can find the options. As a reference take this example from my project:

# run server as a daemon
d = Daemonizer(cherrypy.engine,
               stdout='/home/pi/Gate/log/gate_access.log',
               stderr='/home/pi/Gate/log/gate_error.log')
d.subscribe()
Related