Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to auto-restart a service when it crashes (Apache, Proftpd, Jboss...). I'm running debian. I could script something but I'm trying to find a "good practice" for this.

Do you know a software that can do this?

Thank you

share|improve this question
up vote 6 down vote accepted

DJB's Daemontools can do exactly what you want.

However, it would be more productive in the long run if you could figure out why things are dying and fix the cause, not the symptom.

share|improve this answer
+1 Been using daemontools for years and can't complain. The only downside is that sometimes junior SAs have trouble grokking what DTs are about. – Max A. Nov 24 '09 at 21:00
I'll admit that I'm one of those who don't grok it, but I know it has a good reputation amongst those who do. – David Mackintosh Nov 27 '09 at 15:19
If you like daemontools but aren't a fan of the whole slashpackage thing, I've got a fork... – Mark Johnson Dec 21 '09 at 22:16

Monit is a relatively easy to configure service that will restart services (and more).

share|improve this answer

There are a couple of ways to do this.

You can add it to /etc/inittab with the respawn action, however, this is usually reserved for lower level system processes that the server itself depends on for basic functionality.

A better option would be to monitor your servers and processes using an external program such as nagios, and configuring an eventhandler to restart the services if they go down.

share|improve this answer

Control panels can do this for you as well. For example, here is Webmin

share|improve this answer

Your Answer


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.