build: reload rpcd in package postinstall
authorJo-Philipp Wich <jo@mein.io>
Tue, 3 Mar 2020 08:28:44 +0000 (09:28 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 3 Mar 2020 14:21:55 +0000 (15:21 +0100)
Send a SIGHUP to rpcd after installing LuCI packages to reload ACL rules.

Also remove redundant code while we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
luci.mk

diff --git a/luci.mk b/luci.mk
index 54f3835b418d327c4693d64aea597940b0141e1b..522a21e763e63291f6a60d5c7298078911c9761d 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -221,25 +221,16 @@ define Package/$(PKG_NAME)/install
        else true; fi
 endef
 
-ifneq ($(LUCI_DEFAULTS),)
+ifndef Package/$(PKG_NAME)/postinst
 define Package/$(PKG_NAME)/postinst
 [ -n "$${IPKG_INSTROOT}" ] || {$(foreach script,$(LUCI_DEFAULTS),
        (. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script))
        rm -f /tmp/luci-indexcache
        rm -rf /tmp/luci-modulecache/
+       killall -HUP rpcd 2>/dev/null
        exit 0
 }
 endef
-else
-ifndef Package/$(PKG_NAME)/postinst
-define Package/$(PKG_NAME)/postinst
-[ -n "$${IPKG_INSTROOT}" ] || {
-       rm -f /tmp/luci-indexcache
-       rm -rf /tmp/luci-modulecache/
-       exit 0
-}
-endef
-endif
 endif