uhttpd: Reload config after uhttpd-mod-ubus was added
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 20 Mar 2021 12:19:22 +0000 (13:19 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 21 Mar 2021 21:39:27 +0000 (22:39 +0100)
Without this change the config is only committed, but the uhttpd daemon
is not reloaded. This reload is needed to apply the config. Without the
reload of uhttpd, the ubus server is not available over http and returns
a Error 404.

This caused problems when installing luci on the snapshots and
accessing it without reloading uhttpd.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d25d281fd6686bda67636f6c1df918145b6cb738)

package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/ubus.default

index 796eb6129849fff570f7bae9fcb987fd0e481c44..28a817d2e0d6fabf2f954ea03a001cc1fa598bda 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
index ca9e72a3150a3f8a0339fdd8b7030ad173bfdd82..b218d3f85d11a94534b36878e23db892ca721689 100644 (file)
@@ -3,11 +3,13 @@
 if [ -z "$(uci -q get uhttpd.main.ubus_prefix)" ]; then
        uci set uhttpd.main.ubus_prefix=/ubus
        uci commit uhttpd
+       /etc/init.d/uhttpd reload
 fi
 
 [ "$(uci -q get uhttpd.main.ubus_socket)" = "/var/run/ubus.sock" ] && {
        uci set uhttpd.main.ubus_socket='/var/run/ubus/ubus.sock'
        uci commit uhttpd
+       /etc/init.d/uhttpd reload
 }
 
 exit 0