base-files: add a post start hook for procd managed services

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38024
lede-17.01
John Crispin 2013-09-17 21:45:34 +00:00
parent f874094402
commit 950428fb1b
1 changed files with 20 additions and 1 deletions

View File

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