base-files: add a post start hook for procd managed services
authorJohn Crispin <john@openwrt.org>
Tue, 17 Sep 2013 21:45:34 +0000 (21:45 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 17 Sep 2013 21:45:34 +0000 (21:45 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 38024

package/base-files/files/etc/rc.common

index 22111895db2e3235db2d790a1943ca0e25a42eeb..1984db9c98c2aed1f433cd6dfc6149ef2d2875a0 100755 (executable)
@@ -80,10 +80,18 @@ start_service() {
        return 0
 }
 
+stop_service() {
+       return 0
+}
+
 service_triggers() {
        return 0
 }
 
+service_running() {
+       return 0
+}
+
 stop_service() {
        return 0
 }
@@ -93,6 +101,8 @@ ${INIT_TRACE:+set -x}
 . "$initscript"
 
 [ -n "$USE_PROCD" ] && {
+       EXTRA_COMMANDS="${EXTRA_COMMANDS} running"
+
        . $IPKG_INSTROOT/lib/functions/procd.sh
        basescript=$(readlink "$initscript")
        rc_procd() {
@@ -107,10 +117,19 @@ ${INIT_TRACE:+set -x}
 
        stop() {
                procd_kill "$(basename ${basescript:-$initscript})" "$1"
+               stop_service "$@"
        }
 
        reload() {
-               start
+               if eval "type reload_service" 2>/dev/null >/dev/null; then
+                       reload_service "$@"
+               else
+                       restart
+               fi
+       }
+
+       running() {
+               service_running "$@"
        }
 }