uhttpd: use procd to reload on acme renew
authorGlen Huang <i@glenhuang.com>
Mon, 24 Oct 2022 15:39:55 +0000 (23:39 +0800)
committerJo-Philipp Wich <jo@mein.io>
Fri, 4 Nov 2022 15:21:00 +0000 (16:21 +0100)
Calling /etc/init.d/uhttpd reload directly in the acme hotplug script
can inadvertently start a stopped instance.

Signed-off-by: Glen Huang <i@glenhuang.com>
package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/acme.hotplug [deleted file]
package/network/services/uhttpd/files/uhttpd.init

index 3258b70c855c6edba90e145059f3e7377dbed326..d6a5a271819f7e79871164cf609cbea6d7ea5685 100644 (file)
@@ -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 (file)
index ace15e0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$ACTION" = renewed ]; then
-       /etc/init.d/uhttpd reload
-fi
index 8dbc23f59c1e0120d89ca8c5c84272e63ec4618f..bfde231bf62f700bb87d4b1d4b507a12e3854e66 100755 (executable)
@@ -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() {