monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Ruby process and pid file


From: Jan-Henrik Haukeland
Subject: Re: [monit] Ruby process and pid file
Date: Wed, 19 Nov 2008 18:24:12 +0100


On 19. nov.. 2008, at 17.53, Roberto Druetto wrote:

I'm trying to monitor a ruby process. I followed this guide:
http://mmonit.com/wiki/Monit/FAQ#pidfile in order to create the pid
file, but I'm a little bit confused.
In the FAQ they say to create the pid file in this way: echo $$ >
/var/run/xyz.pid; but at that stage the pid number I get is the one of
the bash script and not the one of the ruby process. So I get the
wrong process monitored.

Make sure that you use exec to execute your ruby script. The pid of the bash script will then be the pid of the ruby program. Also make sure _not_ to use '&' at the end when starting the ruby program as this will fork and start a new process so the pid is wrong, which seems to be the case with your script. Maybe we can have a look at your bash script if this does not work out?





reply via email to

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