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.

24 lines
495 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2009-2019 OpenWrt.org
  3. START=99
  4. STOP=80
  5. USE_PROCD=1
  6. HAPROXY_BIN="/usr/sbin/haproxy"
  7. HAPROXY_CONFIG="/etc/haproxy.cfg"
  8. start_service() {
  9. procd_open_instance
  10. procd_set_param respawn
  11. procd_set_param file "$HAPROXY_CONFIG"
  12. procd_set_param reload_signal USR2
  13. procd_set_param command $HAPROXY_BIN -q -W -db -f "$HAPROXY_CONFIG"
  14. procd_close_instance
  15. }
  16. extra_command "check" "Check haproxy config"
  17. check() {
  18. $HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
  19. }