Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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