新贵(haproxy)

我使用以下命令启动HA代理:
sudo etc / init.d / haproxy启动
我停止使用HA代理:
sudo etc / init.d / haproxy停止
我怎样才能为sudo etc / init.d / something开始或停止写一个基本的新贵脚本?

我可能会参考这里的暴发性文档 – 这个例子是基于这个问题的答案之一,适应其他答案那里也可以工作。 下面的例子应该启动没有PID的haproxy,然后让它在后台运行。

respawn console none start on (local-filesystems and net-device-up IFACE!=lo) stop on [!12345] pre-start exec etc/init.d/haproxy start pre-stop etc/init.d/haproxy stop 

我将其设置为在启动时启动,然后使用monit( http://mmonit.com/monit/ )进行监视。 没有用过暴发户,但这对我来说效果很好。 🙂