暴发户作业(代理)



我正在使用以下命令启动HA代理:
sudo etc/init.d/haproxy start
我停止 HA 代理使用:
sudo etc/init.d/haproxy stop

如何为 sudo etc/init.d/something start or stop 编写基本的暴发户脚本?

以下脚本将起作用。把它放在"/etc/init/haproxy.conf"中,那么你可以用"service haproxy start"启动haproxy服务。请务必检查配置文件的位置

# HAProxy 
description     "HAProxy"
start on runlevel [2345]
stop on runlevel [016]
respawn
respawn limit 2 5
env CONF=/etc/haproxy/haproxy.cfg
pre-start script
    [ -r $CONF ]
end script
exec /usr/local/sbin/haproxy -db -f $CONF

最新更新