Fix the race when monit is used to monitor services which are also

started at boot time via init.d at boot time.
This commit is contained in:
Dawn Chen 2015-05-28 10:16:12 -07:00
parent 9b67435cf3
commit 79a2a4f18d
2 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,13 @@ DAEMON_USER=root
#
do_start()
{
# Avoid a potential race at boot time when both monit and init.d start
# the same service
PIDS=$(pidof $DAEMON)
for PID in ${PIDS}; do
kill -9 $PID
done
# Raise the file descriptor limit - we expect to open a lot of sockets!
ulimit -n 65536

View File

@ -39,6 +39,13 @@ DAEMON_USER=root
#
do_start()
{
# Avoid a potential race at boot time when both monit and init.d start
# the same service
PIDS=$(pidof $DAEMON)
for PID in ${PIDS}; do
kill -9 $PID
done
# Return
# 0 if daemon has been started
# 1 if daemon was already running