procd: Allow initscripts to start one daemon instance at a time
authorPierre Lebleu <pierre.lebleu@technicolor.com>
Thu, 13 Oct 2016 10:52:05 +0000 (12:52 +0200)
committerJohn Crispin <john@phrozen.org>
Tue, 18 Oct 2016 06:53:38 +0000 (08:53 +0200)
Signed-off-by: Pierre Lebleu <pierre.lebleu@technicolor.com>
package/base-files/files/etc/rc.common
package/system/procd/files/procd.sh

index e0de0737331c5cb1b4cbfc3967c860515851d10a..95cf956366686abcdba7d7cad9e313fc8614cab2 100755 (executable)
@@ -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() {
index fa6f8a9792cbe87d8bf080fb7931d5cfb7bce690..290c90eb815f4eb6f42e2b6e3973cc3aaaa39c40 100644 (file)
@@ -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() {