monit-general
[Top][All Lists]
Advanced

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

Re: Can't start service and log doesn't help


From: Martin Pala
Subject: Re: Can't start service and log doesn't help
Date: Wed, 22 Sep 2010 12:18:02 +0200

On Sep 22, 2010, at 9:47 AM, Eric Pailleau wrote:

> Le 22/09/2010 09:41, Daniel Maher a écrit :
>> On 09/21/2010 06:35 PM, Rubén Dávila wrote:
>> 
>>> [CDT Sep 21 10:45:24] debug : restart service
>>> 'unicorn_staging_app.com <http://unicorn_staging_app.com/>' on user
>>> request
>>> [CDT Sep 21 10:45:24] info : monit daemon at 5482 awakened
>>> [CDT Sep 21 10:45:24] info : Awakened by User defined signal 1
>>> [CDT Sep 21 10:45:24] info : 'unicorn_staging_app.com
>>> <http://unicorn_staging_app.com/>' trying to restart
>>> [CDT Sep 21 10:45:24] info : 'unicorn_staging_app.com
>>> <http://unicorn_staging_app.com/>' stop: /etc/init.d/unicorn
>>> [CDT Sep 21 10:45:26] info : 'unicorn_staging_app.com
>>> <http://unicorn_staging_app.com/>' start: /etc/init.d/unicorn
>>> [CDT Sep 21 10:45:56] error : 'unicorn_staging_app.com
>>> <http://unicorn_staging_app.com/>' failed to start
>>> 
>>> I can't find the reason for this problem, although the start program
>>> command "/etc/init.d/unicorn start /etc/unicorn/app.com.conf" starts the
>>> service fine, please any idea for this issue?
>> 
>> Does "/etc/init.d/unicorn start /etc/unicorn/app.com.conf" return 0 ?
>> 
>> 
> monit exec comes without any environnement variable neither path.
> you have to load an environnement either by login or by sourcing a file.
> 
> try  " su - user '/etc/init.d/unicorn start /etc/unicorn/app.com.conf' "
> where user is usual user that run the program.
> Even it is root, you need this to load the root environnement.
> Regards.


Eric is correct, i'm just adding possibility to catch the error output from 
start program (monit currently doesn't log it):

  start program = "/bin/bash -c '/etc/init.d/unicorn start 
/etc/unicorn/app.com.conf > /tmp/unicorn.out 2>>&1'"

We'll add logging of errors from start script in some next Monit version, so 
the above trick won't be necessary.


Regards,
Martin





reply via email to

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