From: Christian Lachner Date: Sat, 2 Nov 2019 11:50:36 +0000 (+0100) Subject: haproxy: Rework hotplug script for HAProxy X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c9ee50d1900921f13319509396d69dae61e3f8ca;p=feed%2Fpackages.git haproxy: Rework hotplug script for HAProxy - The old hotplug script caused long boot-times for r7800 and possibly others. The new script is now only triggered by iface changes for wan and lan interfaces. Signed-off-by: Christian Lachner --- diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 3e891f418d..0d0cbcd4eb 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -172,8 +172,8 @@ define Package/haproxy/install $(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 + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/iface/90-haproxy endef Package/haproxy-nossl/install = $(Package/haproxy/install) diff --git a/net/haproxy/files/haproxy.hotplug b/net/haproxy/files/haproxy.hotplug index bfb5d6da12..5913918a1d 100644 --- a/net/haproxy/files/haproxy.hotplug +++ b/net/haproxy/files/haproxy.hotplug @@ -1,7 +1,7 @@ #!/bin/sh -if [ "$ACTION" = add ]; then +[ "$INTERFACE" == "wan" ] || [ "$INTERFACE" == "lan" ] || return +[ "$ACTION" == "ifup" ] && /etc/init.d/haproxy enabled && \ /etc/init.d/haproxy start -fi