1
0

haproxy.init 558 B

12345678910111213141516171819202122232425
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2009-2010 OpenWrt.org
  3. START=99
  4. STOP=80
  5. SERVICE_USE_PID=1
  6. HAPROXY_BIN="/usr/sbin/haproxy"
  7. HAPROXY_CONFIG="/etc/haproxy.cfg"
  8. HAPROXY_PID="/var/run/haproxy.pid"
  9. start() {
  10. service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
  11. }
  12. stop() {
  13. kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
  14. service_stop $HAPROXY_BIN
  15. }
  16. reload() {
  17. $HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID | tr "\n" " ")
  18. #$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
  19. }