aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/functions10
1 files changed, 6 insertions, 4 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 7a66840c..acef3321 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -380,15 +380,17 @@ status() {
base=${1##*/}
# First try "pidof"
- pid="$(__pids_pidof "$1")"
+ __pids_var_run "$1" "$pid_file"
+ RC=$?
+ if [ -z "$pid_file" -a -z "$pid" ]; then
+ pid="$(__pids_pidof "$1")"
+ fi
if [ -n "$pid" ]; then
echo $"${base} (pid $pid) is running..."
return 0
fi
- # Next try "/var/run/*.pid" files
- __pids_var_run "$1" "$pid_file"
- case "$?" in
+ case "$RC" in
0)
echo $"${base} (pid $pid) is running..."
return 0