aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-09-24 10:07:34 -0400
committerHarald Hoyer <harald@redhat.com>2009-05-04 16:05:04 +0200
commit8e73f0feee8fc7cc4a502989e737b5ff752bd33d (patch)
tree8f7728b956e23ee427f70049baa81b3f8e0b34cc /rc.d/init.d
parent3484d8ed7b9b7eaceef9e1019f52c42121c80c67 (diff)
downloadinitscripts-8e73f0feee8fc7cc4a502989e737b5ff752bd33d.tar
initscripts-8e73f0feee8fc7cc4a502989e737b5ff752bd33d.tar.gz
initscripts-8e73f0feee8fc7cc4a502989e737b5ff752bd33d.tar.bz2
initscripts-8e73f0feee8fc7cc4a502989e737b5ff752bd33d.tar.xz
initscripts-8e73f0feee8fc7cc4a502989e737b5ff752bd33d.zip
Use the pidfile before running pidof in status(). (#440658)
This matches the behavior of killproc.
Diffstat (limited to 'rc.d/init.d')
-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 a13e7a0d..cf9422a9 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -366,15 +366,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