16 messages in com.googlegroups.pylons-discussRe: Daemonizing and auto-restart| From | Sent On | Attachments |
|---|---|---|
| Mike Orr | 22 May 2007 11:59 | |
| Shannon -jj Behrens | 22 May 2007 15:57 | |
| voltron | 22 May 2007 16:04 | |
| Ian Bicking | 22 May 2007 16:19 | |
| Mike Orr | 22 May 2007 16:59 | |
| Max Ischenko | 22 May 2007 21:24 | |
| John_Nowlan | 24 May 2007 11:49 | |
| Mike Orr | 24 May 2007 17:14 | |
| Ian Bicking | 24 May 2007 19:05 | |
| Shannon -jj Behrens | 24 May 2007 21:43 | |
| Max Ischenko | 24 May 2007 22:49 | |
| voltron | 25 May 2007 00:27 | |
| Shannon -jj Behrens | 25 May 2007 06:35 | |
| Ian Bicking | 25 May 2007 08:27 | |
| Mike Orr | 18 Jun 2007 09:58 | |
| Contact 42 | 18 Jun 2007 20:07 |
| Subject: | Re: Daemonizing and auto-restart![]() |
|---|---|
| From: | Ian Bicking (ianb...@public.gmane.org) |
| Date: | 05/22/2007 04:19:30 PM |
| List: | com.googlegroups.pylons-discuss |
Mike Orr wrote:
I'm about to deploy my Pylons application and need to daemonize it and set up auto-restart if it dies. "paster serve production.ini start" does not daemonize it, contrary to what "paster serve --help" says. "paster serve --daemon production.ini" does, but it does not create a PID file so you can't stop it.
I made my configuration file executable and put this at the top:
#!/usr/bin/env paster [exe] command = serve daemon = true pid_file = %(here)/data/paster.pid log_file = %(here)/data/error.log
I can start it and stop it in daemon mode with "./production.ini start" and "./production.ini stop", but if I do "paster serve production.ini start" it starts up in normal console mode with logging to the console. Is this a bug in Paste?
I should probably just take the whole #! thing out, it's really finicky and platform-dependent. Linux and BSD are totally different, for instance, and BSD and OSX are also different from each other, I think. I like the pattern, it just shouldn't use "paster", it should use a completely different script dedicated to this purpose.
My other question is, paster has a --monitor-restart option to restart the server if it dies. But the Pylons Cookbook has recipes for daemontools and supervisor2. Are these better than paster's monitor for some reason, or are they all interchangeable?
They all work the same basic way. paster's is simpler, obviously, since it's just one option. But it hasn't been tested a whole lot, so I dunno. Also it probably has more overhead than daemontools, though I don't know if it really is significant.
--
Ian Bicking | ianb...@public.gmane.org |
http://blog.ianbicking.org
| Write code, do good | http://topp.openplans.org/careers




