You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
548 B

  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. EXTRA_COMMANDS="check"
  7. HAPROXY_BIN="/usr/sbin/haproxy"
  8. HAPROXY_CONFIG="/etc/haproxy.cfg"
  9. HAPROXY_PID="/var/run/haproxy.pid"
  10. start() {
  11. service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
  12. }
  13. stop() {
  14. kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
  15. service_stop $HAPROXY_BIN
  16. }
  17. reload() {
  18. $HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
  19. }
  20. check() {
  21. $HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
  22. }