monit-general
[Top][All Lists]
Advanced

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

Re: [monit] How does start/stop/restart work ?


From: Martin Pala
Subject: Re: [monit] How does start/stop/restart work ?
Date: Fri, 06 Jun 2008 19:41:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-5)

Hi,

Monit sets spartan environment/sandbox ... see FAQ no.6:

--8<--
6. Q: I'm having trouble getting monit to execute any "start" or
      "stop" program commands.  The log file says that they're being
      executed, and I can't find anything wrong when I run monit in
      verbose mode.

   A: Monit did start the program but for some reason the service dies
      later. Before we go on and introduce you to the fine art of
      system debugging, it's worth to note that:

      For security reasons monit purges the environment and only set a
      spartan PATH variable that contains /bin, /usr/bin, /sbin and
      /usr/sbin. If your program or script dies, the reason could be
      that it expects certain environment variables or to find certain
      programs via the PATH. If this is the case you should set the
      environment variables you need directly in the start or stop
      script called by monit.
--8<--

Monit's working directory when running as deamon is "/". Since your scripts use relative path to the binary, it won't be found. The same problem is with the logfile.

If you'll set absolute paths, it should work fine.


Martin




Jonathan Vanasco wrote:

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`


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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