[source] procd: Allow initscripts to start one daemon instance at a time

LEDE Commits lede-commits at lists.infradead.org
Tue Oct 18 00:21:25 PDT 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/6bb11d52f3ae8ce8aa0a270c6ae305809af8b7ce

commit 6bb11d52f3ae8ce8aa0a270c6ae305809af8b7ce
Author: Pierre Lebleu <pierre.lebleu at technicolor.com>
AuthorDate: Thu Oct 13 12:52:05 2016 +0200

    procd: Allow initscripts to start one daemon instance at a time
    
    Signed-off-by: Pierre Lebleu <pierre.lebleu at technicolor.com>
---
 package/base-files/files/etc/rc.common | 4 +++-
 package/system/procd/files/procd.sh    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index e0de073..95cf956 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -102,9 +102,11 @@ ${INIT_TRACE:+set -x}
 	. $IPKG_INSTROOT/lib/functions/procd.sh
 	basescript=$(readlink "$initscript")
 	rc_procd() {
+		local method="set"
+		[ -n "$2" ] && method="add"
 		procd_open_service "$(basename ${basescript:-$initscript})" "$initscript"
 		"$@"
-		procd_close_service
+		procd_close_service "$method"
 	}
 
 	start() {
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index fa6f8a9..290c90e 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -76,7 +76,7 @@ _procd_close_service() {
 	_procd_open_trigger
 	service_triggers
 	_procd_close_trigger
-	_procd_ubus_call set
+	_procd_ubus_call ${1:-set}
 }
 
 _procd_add_array_data() {



More information about the lede-commits mailing list