$(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
- $(INSTALL_DIR) $(1)/etc/hotplug.d/net
- $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
endef
Package/haproxy-nossl/install = $(Package/haproxy/install)
#!/bin/sh /etc/rc.common
-# Copyright (C) 2009-2010 OpenWrt.org
+# Copyright (C) 2009-2019 OpenWrt.org
START=99
STOP=80
-SERVICE_USE_PID=1
+USE_PROCD=1
+
EXTRA_COMMANDS="check"
HAPROXY_BIN="/usr/sbin/haproxy"
HAPROXY_CONFIG="/etc/haproxy.cfg"
-HAPROXY_PID="/var/run/haproxy.pid"
-
-start() {
- service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
-}
-
-stop() {
- kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
- service_stop $HAPROXY_BIN
-}
-reload() {
- $HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
+start_service() {
+ procd_open_instance
+ procd_set_param respawn
+ procd_set_param file "$HAPROXY_CONFIG"
+ procd_set_param reload_signal USR2
+ procd_set_param command $HAPROXY_BIN -q -W -db -f "$HAPROXY_CONFIG"
+ procd_close_instance
}
check() {
- $HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
+ $HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
}