From 134f60e9dfb3e6b4bcd18f7ab866e50808dc25fd Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Sun, 19 Mar 2006 15:01:33 +0000 Subject: (status): Try the PID from the PID file if (pidof) fails (#182623) --- rc.d/init.d/functions | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'rc.d') 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" -- cgit v1.2.1