--- mysql-service-agent 2007-02-02 16:32:48.000000000 -0500 +++ mysql-service-agent-status 2007-07-24 14:11:16.000000000 -0400 @@ -163,6 +163,31 @@ fi case "$1" in + status) + ## Does PID file exist + if test -f $MERLIN_AGENT_PID; then + ## pid-file exists, check if the process is still up + if kill -0 `cat $MERLIN_AGENT_PID` 2> /dev/null; then + ## program is running fine + echo "$MERLIN_AGENT_PSERVICE is running" + exit 0 + else + ## does the lock file exist + if test -f "/var/lock/subsys/$MERLIN_AGENT_SERVICE" ; then + ## program not running, but lock file exists + echo "$MERLIN_AGENT_PSERVICE is not running, but lock file exists" + exit 2 + else + ## program not running, pid-file exists, but no lock file + echo "$MERLIN_AGENT_PSERVICE is not running, but pid-file exists" + exit 1 + fi + fi + else + echo "$MERLIN_AGENT_PSERVICE does not appear to be running" + exit 4 + fi + ;; start) echo $echo_n "Starting $MERLIN_AGENT_PSERVICE service..."