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?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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.
Monit is a relatively easy to configure service that will restart services (and more).
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.
Control panels can do this for you as well. For example, here is Webmin http://doxfer.webmin.com/Webmin/SystemAndServerStatus