monit-general
[Top][All Lists]
Advanced

[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 13:11:48 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

Not sure, but running it as "monit -I &" may work. Usually, like inittab, I put the redirect in the script itself, although I haven't tested either of these.

On 4/28/11 12:01 PM, Michael Mackus wrote:
Hm... well can you suggest a simple way to bypass this? 

I guess I can override my script's "console.log" function, but I'd rather just log all stdout to a file for simplicity.

On Thu, Apr 28, 2011 at 11:58 AM, Rory Toma <address@hidden> wrote:
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 127.0.0.1
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: https://lists.nongnu.org/mailman/listinfo/monit-general


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

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


reply via email to

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