On 13/11/05, loki77 <[EMAIL PROTECTED]> wrote:
>
> Hi- I've been messing with turbogears for a little bit now, and I'm
> just about ready to 'deploy' a turbogears app to my companies intranet.
> I need a way to start & shutdown the application safely on a
> production system, and that means (in unix, at least) a good rc script.
>
> What's stumping me now is that my TurboGears app, when it starts, does
> not write out a .pid file or anything of the like, so I'm not sure what
> the proper way is for my rc script to shut the server down when I tell
> it to.
>
> Does anyone have any hints on how to make this work? Do I need to
> subclass and add functionality to the server class in order to do this?
quick fix: add these lines to your application-start.py (assuming you
used quickstart)
import os
pid = file('app.pid', 'w')
pid.write(str(os.getpid()))
pid.close()
That should at leat give you a pid file. Whether the cherrypy server
responds properly to the usual unix signals, I don't know, but its a
start. It's running via python, so it should do.
If you're on linux and can use start-stop-daemon, that can search for
processes via name or by executable, removing the need for a pid file.
--
wavy davy
"True religion confronts earth with heaven
and brings eternity to bear on time"
- A. W. Tozer