Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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/sshd.pid
   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
add comment

I think you are looking for daemontools (http://cr.yp.to/daemontools.html - "supervise" command) or runit (http://smarden.org/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
1  
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
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.