diff options
Diffstat (limited to 'package/base-files/files/etc/rc.common')
| -rwxr-xr-x | package/base-files/files/etc/rc.common | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 5dcbf5138d5..d7473038444 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -105,9 +105,9 @@ service_data() { } service_running() { - local service="${1:-$(basename $initscript)}" - local instance="${2:-*}" - procd_running "$service" "$instance" "$@" + local instance="${1:-*}" + + procd_running "$(basename $initscript)" "$instance" } ${INIT_TRACE:+set -x} @@ -126,6 +126,7 @@ extra_command "enabled" "Check if service is started on boot" extra_command "running" "Check if service is running" extra_command "status" "Service status" extra_command "trace" "Start with syscall trace" + extra_command "info" "Dump procd service info" . $IPKG_INSTROOT/lib/functions/procd.sh basescript=$(readlink "$initscript") @@ -149,6 +150,13 @@ extra_command "enabled" "Check if service is started on boot" start "$@" } + info() { + json_init + json_add_string name "$(basename ${basescript:-$initscript})" + json_add_boolean verbose "1" + _procd_ubus_call list + } + stop() { procd_lock stop_service "$@" |
