[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: check program reports exit codes that I can't recreate
From: |
Jan-Henrik Haukeland |
Subject: |
Re: check program reports exit codes that I can't recreate |
Date: |
Fri, 31 Oct 2014 21:22:54 +0100 |
If you remove the “with timeout 3 seconds” or increase the timeout value the
“problem" should go away. If the timeout statement is used, Monit will kill
your program if it uses more than _timeout_ time to run. This seems to be the
case here and the exit value 9 comes from Monit sending the kill signal to the
process (by convention).
> On 31 Oct 2014, at 18:15, Russell Simpkins <address@hidden> wrote:
>
> I have a check:
>
> check program foo with path "/usr/bin/check.sh 7005" with timeout 3 seconds
> if start != 0 then
> start with program "/etc/init.d/myservice" with timeout 10 seconds
>
> My script will either exit with a zero or a one. Monit runs as root. I'm
> running monit 5.8 Sometimes monit reports error codes that I can't recreate
> e.g.
>
> Oct 15 13:56:36 ip-10-45-179-177 monit[655]: 'foo' 'check.sh' failed with
> exit status (9) -- no output from program
>
> I can't figure out why monit gets an exit status that I can't recreate. I've
> changed my check to be
>
> if start == 1 then
>
> That seems to have fixed my problem. I also tried the following in my bash
> script:
>
> set -e
>
> Thinking that maybe one of my steps was failing, but I can never recreate any
> other exit code besides 0 when running it by hand. Is this something fixed in
> 5.9?