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: Sat, 07 Jun 2008 20:54:20 +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)

Maybe some other environment variable is missing ... you'll need to add all variables which are need for the start script in the script itself.


Martin



Jonathan Vanasco wrote:

Thanks Marin.

Unfortunately, that doesn't seem to be it though.

I changed everything to absolute paths, and its still giving me a no starts and no error messages.

Is there any  way to trap errors and get more detailed reports?





On Jun 6, 2008, at 1:41 PM, Martin Pala wrote:

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


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




reply via email to

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