【问题标题】:Upstart job (haproxy)新贵工作(代理)
【发布时间】:2012-09-21 13:35:08
【问题描述】:

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

如何为 sudo etc/init.d/something start 或 stop 编写基本的 upstart 脚本?

【问题讨论】:

    标签: haproxy upstart


    【解决方案1】:

    以下脚本将起作用。把它放在“/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
    

    【讨论】:

      猜你喜欢
      • 2013-01-27
      • 2014-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-28
      • 1970-01-01
      • 2013-11-30
      • 1970-01-01
      相关资源
      最近更新 更多