[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [monit] monit command line and capistrano
From: |
Matt Murphy |
Subject: |
Re: [monit] monit command line and capistrano |
Date: |
Mon, 21 Jul 2008 13:19:35 -0700 |
Martin,
Thanks much. I'll investigate further base don your advice.
-Matt
On Mon, Jul 21, 2008 at 12:56 PM, Martin Pala <address@hidden> wrote:
> You can use "set -xv" in the script to get more details, also strace/ltrace
> can help to check the system/library calls.
>
> The problem may be even with PATH variable as described in FAQ, since monit
> sets it to "/bin:/usr/bin:/sbin:/usr/sbin" ... if your path (env) is
> different, it may then some scripts may have problems when it will use
> non-absolute paths.
>
>
> Martin
>
>
> On Jul 21, 2008, at 9:48 PM, Matt Murphy wrote:
>
>> Martin,
>>
>> Hmm... As far as I am aware, the script does not use any environment
>> variables. Do you know if there is a way to simulate starting w/o
>> environment variables on the command line so that I can verify this?
>>
>> -Matt
>>
>> On Mon, Jul 21, 2008 at 12:10 PM, Martin Pala <address@hidden>
>> wrote:
>>>
>>> This is most probably caused by missing environment variable. Monit sets
>>> spartan environment/sandbox when starting services.
>>>
>>> Here is FAQ item regarding short description from FAQ
>>> (http://www.tildeslash.com/monit/doc/faq.php):
>>>
>>> --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<--
>>>
>>> It's possible that your scripts need some environment variable which is
>>> missing ... simply add everything what is needed to your scripts.
>>>
>>>
>>> Martin
>>>
>>> Matt Murphy wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm trying to use monit to control some services, and all are working
>>>> fine except thin (web server).
>>>>
>>>> Oddly, when I do a fresh deploy with Capistrano, using monit to stop
>>>> and start the thin webserver seems not to work. The process age
>>>> continues to increment whereas the other processes show 0 seconds of
>>>> uptime and begin counting again after the deploy.
>>>>
>>>> I've tried a variety of start and stop commands, and have finally
>>>> resorted to having capistrano use "/usr/bin/thin stop -P
>>>> /path/to/pidfile -c /path/to/app". When I had this as the stop
>>>> command in monit, thin would not stop reliably (maybe about 1 in 10
>>>> times) on deploy.
>>>>
>>>> In case you're not familiar with Capistrano, it's just a deployment
>>>> automation utility that executes shell commands remotely. In this
>>>> case it's executing: sudo monit stop thin9000 (but failing to make it
>>>> stop even though monitrc has the stop command as above).
>>>>
>>>> Not sure if there are any thin users on this list but I thought I'd
>>>> ask generally what I might do to debug this further (tailing syslog
>>>> doesn't seem to reveal anything useful).
>>>>
>>>> thanks in advance!
>>>>
>>>>
>>>> --
>>>> To unsubscribe:
>>>> http://lists.nongnu.org/mailman/listinfo/monit-general
>>>
>>>
>>> --
>>> To unsubscribe:
>>> http://lists.nongnu.org/mailman/listinfo/monit-general
>>>
>>
>>
>> --
>> To unsubscribe:
>> http://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general
>