aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-03-19 15:01:33 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-03-19 15:01:33 +0000
commit134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd (patch)
tree43aed1cebc91ca5d35950748067dc310e125b421 /rc.d/init.d
parentff24397011ffa2d921051ae42efcd8eef7f15010 (diff)
downloadinitscripts-134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd.tar
initscripts-134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd.tar.gz
initscripts-134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd.tar.bz2
initscripts-134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd.tar.xz
initscripts-134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd.zip
(status): Try the PID from the PID file if (pidof) fails (#182623)
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/functions15
1 files changed, 9 insertions, 6 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 3db40360..6638bcee 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -319,14 +319,17 @@ status() {
fi
# Next try "/var/run/*.pid" files
- [ -z "$pid_file" ] && pid_file=/var/run/${base}.pid
- if [ -f "$pid_file" ] ; then
- read pid < "$pid_file"
- if [ -n "$pid" ]; then
+ __pids_var_run "$1" "$pid_file"
+ case "$?" in
+ 0)
+ echo $"${base} (pid $pid) is running..."
+ return 0
+ ;;
+ 1)
echo $"${base} dead but pid file exists"
return 1
- fi
- fi
+ ;;
+ esac
# See if /var/lock/subsys/${base} exists
if [ -f /var/lock/subsys/${base} ]; then
echo $"${base} dead but subsys locked"