25

Are Upstart and Supervisord interchangeable? Do they work together? I am looking to run a python program as root when my system (debian) boots. After the boot, I would like the process manager to continue running the program if it crashes. Which would be better suited to do this?

Alexis
  • 23,545
  • 19
  • 104
  • 143

1 Answers1

36

Upstart was developed as a replacement for the traditional init daemon. Supervisord is a process manager (with a lot of features), but it still needs to be run by an init daemon in itself.

I personally find Upstart is enough for most of my use cases, and from your question I think it will do just fine for you as well.

There are four upstart stanzas that should be of particular interest to you: start on, stop on, respawn and exec. You can read more about them at http://upstart.ubuntu.com/cookbook/.

If you still prefer to go for the Supervisord route this seems like a good thread to get you started - https://serverfault.com/questions/96499/how-to-automatically-start-supervisord-on-linux-ubuntu

Community
  • 1
  • 1
Erik Näslund
  • 1,196
  • 11
  • 9
  • I know this is an old question, but it seems like upstart was created because running things by an init daemon is bad. Is it considered bad? – Ryan-Neal Mes Jul 18 '15 at 15:10
  • 1
    @Ryan-NealMes, I think calling running things via init bad is a stretch. It's really a matter of ease, from what I've seen. Many modern packages on Ubuntu install both an init and upstart script. Compare the two and you will that the init script is a huge behemoth while the upstart script is tiny and tidy. I never wrote daemon initializers before upstart came along because it was just too much of a headache. With upstart I don't mind writing them at all. – David Baucum Apr 07 '16 at 15:52