[PATCH] rpcd: restart rpcd on installation of rpcd-mod-*

Daniel Golle daniel at makrotopia.org
Thu Oct 28 13:41:30 PDT 2021


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 restarted
(or the system has been rebooted, obviously).
Let rpcd-mod-* restart rpcd as post-install action.

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/system/rpcd/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
index 9880ea4d66..383c7ac7f9 100644
--- a/package/system/rpcd/Makefile
+++ b/package/system/rpcd/Makefile
@@ -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 restart
+  endef
+
   define Package/rpcd-mod-$(1)/install
 	$(INSTALL_DIR) $$(1)/usr/lib/rpcd
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
-- 
2.33.0




More information about the openwrt-devel mailing list