From 46fbe55971c0e42bc1603bca424f3ff5384f15a6 Mon Sep 17 00:00:00 2001 From: Glen Huang Date: Mon, 24 Oct 2022 23:39:55 +0800 Subject: [PATCH] uhttpd: use procd to reload on acme renew Calling /etc/init.d/uhttpd reload directly in the acme hotplug script can inadvertently start a stopped instance. Signed-off-by: Glen Huang --- package/network/services/uhttpd/Makefile | 4 +--- package/network/services/uhttpd/files/acme.hotplug | 3 --- package/network/services/uhttpd/files/uhttpd.init | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 package/network/services/uhttpd/files/acme.hotplug diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 3258b70c85..d6a5a27181 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git @@ -113,8 +113,6 @@ define Package/uhttpd/install $(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd - $(INSTALL_DIR) $(1)/etc/hotplug.d/acme - $(INSTALL_DATA) ./files/acme.hotplug $(1)/etc/hotplug.d/acme/00-uhttpd endef define Package/uhttpd-mod-lua/install diff --git a/package/network/services/uhttpd/files/acme.hotplug b/package/network/services/uhttpd/files/acme.hotplug deleted file mode 100644 index ace15e09c9..0000000000 --- a/package/network/services/uhttpd/files/acme.hotplug +++ /dev/null @@ -1,3 +0,0 @@ -if [ "$ACTION" = renewed ]; then - /etc/init.d/uhttpd reload -fi diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 8dbc23f59c..bfde231bf6 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -222,6 +222,7 @@ start_instance() service_triggers() { procd_add_reload_trigger "uhttpd" + procd_add_raw_trigger acme.renew 5000 /etc/init.d/uhttpd reload } start_service() { -- 2.30.2