[openwrt/openwrt] procd: do not overwrite service data by default

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 17 12:58:41 PST 2024


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8c5826b140b6288b9270d232ecda0d540e380d4e

commit 8c5826b140b6288b9270d232ecda0d540e380d4e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Dec 17 21:21:37 2024 +0100

    procd: do not overwrite service data by default
    
    Allows a running servie to manage its own data if untouched by the init script
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/base-files/files/etc/rc.common | 4 ----
 package/system/procd/files/procd.sh    | 8 +++++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index d747303844..abf72ea337 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -100,10 +100,6 @@ service_triggers() {
 	return 0
 }
 
-service_data() {
-	return 0
-}
-
 service_running() {
 	local instance="${1:-*}"
 
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index 5dc8ec42b7..59e002036d 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -101,9 +101,11 @@ _procd_close_service() {
 	_procd_open_trigger
 	service_triggers
 	_procd_close_trigger
-	_procd_open_data
-	service_data
-	_procd_close_data
+	type service_data >/dev/null 2>&1 && {
+		_procd_open_data
+		service_data
+		_procd_close_data
+	}
 	_procd_ubus_call ${1:-set}
 }
 




More information about the lede-commits mailing list