Haproxy啟動指令碼

來源:互聯網
上載者:User

標籤:haproxy 啟動

指令碼如下:

#!/bin/sh# chkconfig 2345 on# description: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.if [ -f /etc/init.d/functions ]; then. /etc/init.d/functionselif [ -f /etc/rc.d/init.d/functions ] ; then. /etc/rc.d/init.d/functionselseexit 0fi# Source networking configuration.. /etc/sysconfig/network# Check that networking is up.[ ${NETWORKING} = "no" ] && exit 0config="/etc/haproxy/haproxy.cfg"exec="/usr/local/haproxy/sbin/haproxy"PID="/var/run/haproxy.pid"[ -f $config ] || exit 1RETVAL=0start() {  daemon $exec -c -q -f $config    if [ $? -ne 0 ]; then        echo "Errors found in configuration file."        return 1    fi  echo -n "Starting HAproxy: "  $exec -D -f $config -p $PID  RETVAL=$?  echo  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haproxy  return $RETVAL}stop() {echo -n "Shutting down HAproxy: "killproc haproxy -USR1RETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/haproxy[ $RETVAL -eq 0 ] && rm -f $PIDreturn $RETVAL}restart() {$exec -c -q -f $config   if [ $? -ne 0 ]; then       echo "Errors found in configuration file, check it with ‘haproxy check‘."       return 1   fistopstart}rhstatus() {status haproxy}# See how we were called.case "$1" instart)        start        ;;stop)        stop        ;;restart)        restart        ;;status)        rhstatus        ;;*)        echo $"Usage: haproxy {start|stop|restart|status}"        RETVAL=1        esac        exit $RETVAL


本文出自 “不求最好,只求更好” 部落格,請務必保留此出處http://yujianglei.blog.51cto.com/7215578/1725994

Haproxy啟動指令碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.