rpcd: reload rpcd on installation of rpcd-mod-*
authorDaniel Golle <daniel@makrotopia.org>
Fri, 29 Oct 2021 11:14:16 +0000 (12:14 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 8 Nov 2021 14:21:02 +0000 (14:21 +0000)
When installing additional rpcd modules, a restart of rpcd is required.
This often confuses users as even after installing rpcd-mod-rpcsys the
relevant ubus objects are still missing until rpcd has been reloaded
(or the system has been rebooted, obviously).
Let rpcd-mod-* reload rpcd as post-install action.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/system/rpcd/Makefile

index 2827e955dbef00a05913bba4b7f8d88dc74108de..9b1f239623d4352c4b564ba0397b37629d86f226 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rpcd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
@@ -84,6 +84,11 @@ define BuildPlugin
     $(3)
   endef
 
+  define Package/rpcd-mod-$(1)/postinst
+#!/bin/sh
+[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/rpcd reload
+  endef
+
   define Package/rpcd-mod-$(1)/install
        $(INSTALL_DIR) $$(1)/usr/lib/rpcd
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/