Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What is an easy convenient automatic service recovery option?

Basically if for example iptables stops I wish it to be automatically start soon after. I would like to apply this to 6-10 services.

share|improve this question
up vote 3 down vote accepted

we have used monit in the past. Its syntax looks like this:

check process sshd with pidfile /var/run/
   start program  "/etc/init.d/ssh start"
   stop program  "/etc/init.d/ssh stop"
   if failed port 22 protocol ssh then restart
   if 5 restarts within 5 cycles then timeout

Now we use the processes capabilities of CFengine to restart/kill processes for a very broad range of reasons, but you need to have an existing CFengine infrastructure to do that.

share|improve this answer

I think you are looking for daemontools ( - "supervise" command) or runit (

share|improve this answer
I'd like to avoid runit as I've read about some stability issues. I will check out daemon tools. – Joshua Enfield Oct 21 '10 at 18:31
I've been running daemontools in production for a long time. Solid stuff. The daemon has to run in the foreground to work with daemoontools, which would not be suitable for "iptables." iptables allows you to enter rules into netfilter in the kernel and is not a daemon. – Warner Oct 21 '10 at 18:55

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.