自动服务恢复(Linux)

什么是简单方便的自动服务恢复选项?

基本上,如果例如iptables停止,我希望它自动启动后不久。 我想申请这个6-10服务。

我们过去曾经使用过monit 。 它的语法如下所示:

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 

现在我们使用CFengine的进程function来重启/ 终止进程,原因很多,但是你需要有一个现有的CFengine基础设施来做到这一点。

我想你正在寻找daemontools( http://cr.yp.to/daemontools.html – “supervise”命令)或者runit( http://smarden.org/runit/