[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [monit] How does start/stop/restart work ?
From: |
John |
Subject: |
Re: [monit] How does start/stop/restart work ? |
Date: |
Sat, 7 Jun 2008 12:30:41 -0700 (PDT) |
--- On Fri, 6/6/08, Jonathan Vanasco <address@hidden> wrote:
> From: Jonathan Vanasco <address@hidden>
> Subject: [monit] How does start/stop/restart work ?
> To: address@hidden
> Date: Friday, June 6, 2008, 10:04 AM
> I have monit configured to restart a website.
>
> the problem is that i get 30 alerts and all failed
> restarts... and
> there seems to be no logging whatsoever of the attempt
> aside from
> 'failed' in the monit log
>
> so i do not know why monit can restart
>
> can anyone tell me how i can get better reporting from
> monit , and
> how the start/stop actually works?
>
> my system requirements mean i can not have scripts in /etc
> - they
> need to go in user spaces. i'm wondering if problems
> have to do with
> my setup (below). though I can't tell because of no
> logging.
>
>
> check process devsite
> with pidfile
> "/home/devsite/_current/log/production.pid"
> start program =
> "/home/devsite/_current/production-start"
> stop program =
> "/home/devsite/_current/production-kill"
> if failed port 5102 with timeout 5 seconds then
> restart
> if failed url http://127.0.0.1:5102/corporate then
> restart
> if 5 restarts within 5 cycles then timeout
> set alert address@hidden
>
> /home/devsite/_current/production-start
> paster serve --pid-file=log/production.pid --log-file=log/
>
> production.log production.ini &
> /home/devsite/_current/production-kill
> kill `cat /home/devsite/_current/log/production.pid`
>
>
If monit can restart which I assume you mean your process, this leads me to
believe the problem with your start is a permission issue. I use monit to
monitor my MythTV backend and I had the same problem you were having. I run my
system as a user instead of root. The reason for my problems was a result of
monit not being able to write the pid file to the directory that had root
permissions. I tried doing the same thing you did by moving the pid file to a
different directory but it still failed since Myth also creates a lock file and
I couldn't change the directory. I think what's happening is once you start the
system monit can restart since the pid and lock files have already been
created. In the end, I found a different start script that allowed me to set
the user thus it solved my problem.