From 8c5826b140b6288b9270d232ecda0d540e380d4e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 21:21:37 +0100 Subject: [PATCH] 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 --- 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 d7473038444c..abf72ea3372f 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 5dc8ec42b7a4..59e002036d95 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} }