[Top][All Lists]

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

Re: Monit service not logging stdout

From: Rory Toma
Subject: Re: Monit service not logging stdout
Date: Thu, 28 Apr 2011 11:58:22 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

monit in daemon mode, as described in the Stevens book, forks, setsids and closes stdout, stdin and stderr, hence, you won't get anything from stdout.

On 4/28/11 11:50 AM, Michael Mackus wrote:
I have a simple monit service set up, so I have something to keep my node.js server running. The service works fine, but I can't get stdout to log to a file. I'm not sure what I'm doing wrong here, if I call the command directly it works fine, but Monit must be wrapping it somehow that stdout is not being written to the file properly. Here is my monit.d script:

check host nodechat with address
start program = "/usr/local/bin/node /home/node/chat_blog/chat.js > /var/log/nodechat.log"
stop program = "/usr/bin/pkill -f 'node /home/node/chat_blog/chat.js'"
if failed port 8000 protocol HTTP
request /
with timeout 10 seconds
then restart

If I execute "/usr/local/bin/node /home/node/chat_blog/chat.js > /var/log/nodechat.log" directly (without the quotes) it works fine. 

-- To unsubscribe:

reply via email to

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