aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-07-23 12:06:29 +0200
committerPetr Štetiar <ynezz@true.cz>2019-09-15 20:58:30 +0200
commited5b9129d7a47adaecdce694cec8e7b61131a9da (patch)
tree0422265f3f652b5199a77dbc03cda586a092ca97 /package/base-files/files
parenta33d60c896233fb2c5b48bf583a97f25213e53d7 (diff)
downloadupstream-ed5b9129d7a47adaecdce694cec8e7b61131a9da.tar.gz
upstream-ed5b9129d7a47adaecdce694cec8e7b61131a9da.tar.bz2
upstream-ed5b9129d7a47adaecdce694cec8e7b61131a9da.zip
base-files: implement generic service_running
DRY is good, otherwise we're going to suffer with a copy&paste disease in the init scripts. Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/rc.common7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 75dbeedf34..37adab0c54 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -95,7 +95,9 @@ service_data() {
}
service_running() {
- return 0
+ local service="${1:-$(basename $initscript)}"
+ local instance="${2:-*}"
+ procd_running "$service" "$instance" "$@"
}
${INIT_TRACE:+set -x}
@@ -104,6 +106,9 @@ ${INIT_TRACE:+set -x}
[ -n "$USE_PROCD" ] && {
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
+ EXTRA_HELP="\
+ running Check if service is running
+ "
. $IPKG_INSTROOT/lib/functions/procd.sh
basescript=$(readlink "$initscript")