Switched to using checkproc in casa_atvd init scrip when checking the
status of the daemon.
This commit is contained in:
parent
e5fea0a0a2
commit
8888e5d330
@ -39,19 +39,8 @@
|
|||||||
# First reset status of this service
|
# First reset status of this service
|
||||||
rc_reset
|
rc_reset
|
||||||
|
|
||||||
MyStatus()
|
|
||||||
{
|
|
||||||
ps ax | grep "$DAEMON" | grep -v grep 2>&1 > /dev/null
|
|
||||||
if [ "x$?" = "x0" ]; then
|
|
||||||
RVAL=0
|
|
||||||
else
|
|
||||||
RVAL=3
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
START_DAEMON_CMD=start_daemon
|
START_DAEMON_CMD=start_daemon
|
||||||
START_DAEMON_CMD_FLAG=-u
|
START_DAEMON_CMD_FLAG=-u
|
||||||
STATUS=MyStatus
|
|
||||||
LOG_SUCCESS=log_success_msg
|
LOG_SUCCESS=log_success_msg
|
||||||
LOG_FAILURE=log_failure_msg
|
LOG_FAILURE=log_failure_msg
|
||||||
LOG_WARNING=log_warning_msg
|
LOG_WARNING=log_warning_msg
|
||||||
@ -129,7 +118,19 @@ restart|reload|force-reload)
|
|||||||
StartDAEMON
|
StartDAEMON
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
$STATUS
|
echo -n "Checking for casa_atvd: "
|
||||||
|
## Check status with checkproc(8), if process is running
|
||||||
|
## checkproc will return with exit status 0.
|
||||||
|
|
||||||
|
# Status has a slightly different for the status command:
|
||||||
|
# 0 - service running
|
||||||
|
# 1 - service dead, but /var/run/ pid file exists
|
||||||
|
# 2 - service dead, but /var/lock/ lock file exists
|
||||||
|
# 3 - service not running
|
||||||
|
|
||||||
|
# NOTE: checkproc returns LSB compliant status values.
|
||||||
|
checkproc $DAEMON
|
||||||
|
RVAL=$?
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -n "Usage: $0 <start|stop|restart|reload|force-reload>" > /dev/stderr
|
echo -n "Usage: $0 <start|stop|restart|reload|force-reload>" > /dev/stderr
|
||||||
|
Loading…
Reference in New Issue
Block a user