diff options
author | John Crispin <john@openwrt.org> | 2013-09-17 21:45:34 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2013-09-17 21:45:34 +0000 |
commit | 950428fb1b0e93781b8f68cbbb1007753aa78179 (patch) | |
tree | fc241cd3b662b34e24dc54814edc93144e11841c /package | |
parent | f87409440298121ae1fbd718a17267cc180438e4 (diff) | |
download | mtk-20170518-950428fb1b0e93781b8f68cbbb1007753aa78179.zip mtk-20170518-950428fb1b0e93781b8f68cbbb1007753aa78179.tar.gz mtk-20170518-950428fb1b0e93781b8f68cbbb1007753aa78179.tar.bz2 |
base-files: add a post start hook for procd managed services
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 38024
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/etc/rc.common | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 2211189..1984db9 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -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 "$@" } } |