Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Running Processes. I’ve been searching for a good solution to this problem (“run this program, and restart it if it falls over”) for years. I’m currently using god which works pretty well, but according to this article I should be learning upstart instead. It never ceases to amaze me how difficult this is, and how obtuse the tools are.

Tagged , , , , ,

10 comments

  1. Quite agree. It seems like a minefield with so many options.

    I've been using runit (mostly for guinicorn) - but I think that will change as runit doesn't seem to work with redis.

    I've heard good things about upstart and was planning to look into it tonight.

    It's a massive pain.

    Dougal Matthews - 2nd March 2010 10:12 - #

  2. Glad I'm not the only one who finds this to be a minefield. Thanks for the pointer!

    Dethe Elza - 2nd March 2010 15:57 - #

  3. Check out supervisord (http://supervisord.org/) it's dead simple.

    Eric Moritz - 2nd March 2010 16:09 - #

  4. Seconding supervisord. Does things the right way ("running" rather than "starting"), has a convenient web-accessible management interface, and makes it simple to specify environment variables for the child process to run in and what uid to run the process as. The only thing I don't like about it is that to add a process or change it's config, every process it controls has to get stopped and restarted.

    Anders Pearson - 2nd March 2010 16:36 - #

  5. You should definitely learn upstart, this is basically the process management system of Solaris ported to Linux. I am using it to keep things running on Indefero not a single problem in more than a year of use.

    You can couple it with monit for information purpose (not to restart the processes as upstart takes care of that).

    Loïc d'Anterroches - 2nd March 2010 17:14 - #

  6. Used daemontools for ages but it was always a pain to install (at least on centos), and then thought I'd give Bluepill a blast. Really liking it, especially the configuration.

    Duncan Robertson - 2nd March 2010 17:25 - #

  7. I second Upstart. I just learned how to setup jobs with it, and I've gotta say it's actually really simple. I prefer it over monit or god for keeping daemons running.

    It's event based and it'll eventually take the place of /etc/init.d (and /etc/rc.*) for system startup and shutdown. Instead of putting init scripts in sequential order, Upstart lets you set conditions for things starting and stopping (i.e. I set apache2 to start after the network scripts run). I still use monit for reporting and alerts, though. I never really liked god for some reason.

    Mike Green - 4th March 2010 21:21 - #

  8. We had problems with god - leaked memory (might be an MRI issue, but end result was bad). Now using monit for redis and similar processes, but upstart seems like a better option. Thanks for the pointer.

    James Abley - 7th March 2010 10:05 - #

  9. Upstart is pretty good, but it's hard to set it up to manage per user service directories.

    But it turns out it's pretty easy to get daemontools to do this, as svscan can be supplied an arbitrary services directory. The environment and uid/gid setting tools are pretty handy, too.

    I put together a quick guide: http://angrymonkey.net.nz/wiki/Process_Supervision _for_Web_Developers

    John Morton - 16th March 2010 12:42 - #

  10. This article achiveed exactly what I wanted it to achieve.

    Audel - 16th August 2011 05:50 - #

Comments are closed.
A django site