diff options
author | Bill Nottingham <notting@redhat.com> | 2008-09-24 10:07:34 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2008-09-24 10:07:34 -0400 |
commit | 27bb4e72ea41d86efa0478d27026f80e2cc4a75f (patch) | |
tree | 696f0e54f75dd273bf27e6e33177907b1c024c52 | |
parent | d027a8366d22b2aa7a54ef8c030fff4024bdd5b9 (diff) | |
download | initscripts-27bb4e72ea41d86efa0478d27026f80e2cc4a75f.tar initscripts-27bb4e72ea41d86efa0478d27026f80e2cc4a75f.tar.gz initscripts-27bb4e72ea41d86efa0478d27026f80e2cc4a75f.tar.bz2 initscripts-27bb4e72ea41d86efa0478d27026f80e2cc4a75f.tar.xz initscripts-27bb4e72ea41d86efa0478d27026f80e2cc4a75f.zip |
Use the pidfile before running pidof in status(). (#463205)
This matches the behavior of killproc.
-rwxr-xr-x | rc.d/init.d/functions | 10 |
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 |