monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Soft and hard stop command


From: Martin Pala
Subject: Re: Soft and hard stop command
Date: Fri, 13 Mar 2015 12:07:39 +0100

Yes, this should work.

Also note that you can simplify connection test - monit 5.10 and newer have 
support redis protocol test:

check process redis with pidfile /usr/local/redis/redis.pid
   start program = "/usr/local/redis/start.sh" with timeout 60 seconds
   stop program  = "/usr/local/redis/stop.sh"
   if failed port 6379 protocol redis then restart
   if 3 restarts within 3 cycles then exec "killall -9 redis"
   if 6 restart within 6 cycles then timeout

Regards,
Martin


> On 13 Mar 2015, at 09:35, Maciej Ostaszewski <address@hidden> wrote:
> 
> I need "soft" and "hard" stop command.
> Hard stop command will be executed only when stop command does not
> work for 3 times.
> What is the best method to achieve  this?
> Will this work?
> 
> check process redis with pidfile /usr/local/redis/redis.pid
>    start program = "/usr/local/redis/start.sh" with timeout 60 seconds
>    stop program  = "/usr/local/redis/stop.sh"
>    if failed host localhost port 6379
>        send "PING\n"
>        expect "PONG"
>    then restart
>    if 3 restarts within 3 cycles then exec "killall -9 redis"
>    if 6 restart within 6 cycles then timeout
> 
> maciek
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

[Prev in Thread] Current Thread [Next in Thread]