monit-general
[Top][All Lists]
Advanced

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

Re: Stop/Start happening simultaneously


From: Jan-Henrik Haukeland
Subject: Re: Stop/Start happening simultaneously
Date: Fri, 30 Mar 2007 13:54:02 +0200

On 29. mar. 2007, at 23.49, Cyrus Mehta wrote:

Can I get away with:
      start = "sleep 60 && /mycompany/script/runService.sh schedserver
start "
or do I have to do the following:
      start = "bash -c 'sleep 60 && /mycompany/script/runService.sh
schedserver start' "

You need to do the last one. The start command is run through exec (see man execv), so if you want to do shell-scripting you need to start a shell. You may also put that sleep call into the top of the runService.sh instead.

Apropos your previous question about restart. Monit does wait for the process to stop running before it call the start command. This means that stop and start does not happen simultaneously, but in sequence and that the process is truly stopped, i.e. it does not exist in the process table, before it is started again.

Don't know if you do so in "/mycompany/script/runService.sh schedserver stop", but if you take down a process with a kill, system resources used by the program may need some time to be released in the kernel. For instance bound socket connections (not using SO_REUSEADDR) may prevent rebinding a socket to the same port and so on. Maybe that is the reason you have a problem getting the program up again after a monit restart?



reply via email to

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