Bug 337483. Modify micasad script to report

correct status.
This commit is contained in:
Jim Norman 2008-05-05 17:55:21 +00:00
parent a33fdd0960
commit 83e1a14664
2 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 5 11:51:53 MDT 2008 - jnorman@novell.com
- Bug 337483. Modify micasad script to report
correct status.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Apr 16 15:46:50 MDT 2008 - jnorman@novell.com Wed Apr 16 15:46:50 MDT 2008 - jnorman@novell.com

View File

@ -36,13 +36,41 @@ function pid_exists()
function process_running() function process_running()
{ {
kill -0 `cat /var/run/micasad.pid` 2> /dev/null ## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
# checkproc $MICASAD_BIN
# NOTE: rc_status knows that we called this init script with
# "status" option and adapts its messages accordingly.
MICASAD_PROC=`ps -eo pid,cmd | grep /usr/bin/micasad.exe | grep -v grep | cut -d ' ' -f1`
echo $MICASAD_PROC
if [ -z $MICASAD_PROC ]
then
MICASAD_PROC=`ps -eo pid,cmd | grep -v grep | grep /usr/bin/micasad.exe | cut -d ' ' -f2`
fi
if [ -n "$MICASAD_PROC" ]
then
return 0
else
return 1
fi
rc_status -v
} }
function is_running() function is_running()
{ {
pid_exists && process_running pid_exists && process_running
} }
case "$1" in case "$1" in