I have a some jvm based processes that I need to make sure start whenever my server is rebooted, and also if it stops because of an unexpected error etc.

I'm running Ubuntu 12.04 in case in matters.

I have seen sample upstart scripts and I am sort of leaning that way, but I want to understand what the differences is going with something like upstart or supervisord.

Are they used for the exact same purposes or there are differences in functionality?


The difference is that upstart is an init replacement whereas supervisord is a Process Control System. This explanation is given on the supervisord site:

It shares some of the same goals of programs like launchd, daemontools, and runit. Unlike some of these programs, it is not meant to be run as a substitute for init as “process id 1”. Instead it is meant to be used to control processes related to a project or a customer, and is meant to start like any other program at boot time.

This means that supervisord itself would be started by upstart, either via an upstart job file, or a sysV init script. Personally, I have chosen to use a process manager rather than plain init starting for the following reasons:

  1. The service does not properly daemonize
  2. The service is known to die an needs to be monitored and restarted

An example of a program not properly daemonizing is when it doesn't close stdout and stderr and continues to write data to those locations. Supervisord can handle the logging of that output.

  • I see, not sure I fully understand, but I thought upstart can also restart the process if it fails. – Blankman Jan 1 '13 at 15:29
  • @Blankman I guess there is even less reason with modern init systems – jordanm Jan 1 '13 at 18:15
  • I'd note that the proper solution to a service that doesn't properly daemonizes would be to fix the bug with said service that cause it to not daemonize properly. I'll grant that something like supervisord would be useful for #2, though. – Shadur Mar 28 '13 at 11:57
  • 1
    @shadur I don't agree that is the best solution. The process might not be owned by you, so you can't fix it. Even if you can fix it, no matter how many bugs you fix, you can never know that there aren't more lurking, and years later, your process will die once again, in production, due to some situation that has never been exposed before, such as an unusual network or database condition. Would you prefer that your site remain offline, frustrating users, costing you money? No. You need a tool to restart services. Period. – Jonathan Hartley Mar 1 '17 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.