Procházet zdrojové kódy

base-files: fix service_running check

The following command checks if a instance of a service is running.
/etc/init.d/<service> running <instance>

 In the variable `$@`, which is passed to the function
`service_running`, the first argument is always the `instance` which
should be checked. Because all other variables where removed from `$@`
with `shift`.

Before this change the first argument of `$@` was set to the `$service`
Variable. So the function does not work as expected. The `$service`
variable was always the instance which should be checked. This is not
what we want.

Signed-off-by: Florian Eckert <[email protected]>
Reviewed-by: Sungbo Eo <[email protected]>
Florian Eckert před 4 roky
rodič
revize
dd681838d3
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      package/base-files/files/etc/rc.common

+ 3 - 3
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}