[openwrt/openwrt] rpcd: adapt defaults for changed ubus.sock path
LEDE Commits
lede-commits at lists.infradead.org
Thu Oct 22 10:16:42 EDT 2020
dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0b31713c856a0d8c6fe2961113a9317f7c3659dc
commit 0b31713c856a0d8c6fe2961113a9317f7c3659dc
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu Oct 22 15:02:58 2020 +0100
rpcd: adapt defaults for changed ubus.sock path
Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
package/system/rpcd/Makefile | 4 +++-
package/system/rpcd/files/50-migrate-rpcd-ubus-sock.sh | 6 ++++++
package/system/rpcd/files/rpcd.config | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
index 051e4c5edd..917ad6ff86 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
@@ -63,6 +63,8 @@ define Package/rpcd/install
$(INSTALL_DATA) $(PKG_BUILD_DIR)/unauthenticated.json $(1)/usr/share/rpcd/acl.d/unauthenticated.json
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/rpcd.config $(1)/etc/config/rpcd
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/50-migrate-rpcd-ubus-sock.sh $(1)/etc/uci-defaults
endef
diff --git a/package/system/rpcd/files/50-migrate-rpcd-ubus-sock.sh b/package/system/rpcd/files/50-migrate-rpcd-ubus-sock.sh
new file mode 100755
index 0000000000..1365aed39a
--- /dev/null
+++ b/package/system/rpcd/files/50-migrate-rpcd-ubus-sock.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+[ "$(uci get rpcd. at rpcd[0].socket)" = "/var/run/ubus.sock" ] && {
+ uci set rpcd. at rpcd[0].socket='/var/run/ubus/ubus.sock'
+ uci commit rpcd
+}
diff --git a/package/system/rpcd/files/rpcd.config b/package/system/rpcd/files/rpcd.config
index faaed7f538..176c643f17 100644
--- a/package/system/rpcd/files/rpcd.config
+++ b/package/system/rpcd/files/rpcd.config
@@ -1,5 +1,5 @@
config rpcd
- option socket /var/run/ubus.sock
+ option socket /var/run/ubus/ubus.sock
option timeout 30
config login
More information about the lede-commits
mailing list