monit-general
[Top][All Lists]
Advanced

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

Re: Basic q's abt monit 4.5.1


From: anuj agrawal
Subject: Re: Basic q's abt monit 4.5.1
Date: Wed, 21 Sep 2005 06:28:13 +0100 (BST)

Hi Martin,

Thanks again...each of ur replies are improving my
understanding of MONIT.

Here is another doubt for you....

I have written the code for the startup of my server
in a shell script like..

xxx.sh
#!/bin/bash

cd ...
/*Code for the startup of the server*/

i made the shell script executable.
Now,when i directly run this shell script from the
terminal(>./xxx.sh) it works just fine i.e. the server
starts as desired and everything written in the shell
script is performed.

The problem -> When i give this shell script as the
"start" program in my "monitrc" file:

check process xxx with pidfile xxx
     start program = "/root/xxx.sh"
 
then the server does not start...the monit gui shows
the message "Internal server error" "could not start
the service"...

Ne idea abt where i may be going wrong???

Anuj


--- Martin Pala <address@hidden> wrote:

> anuj agrawal wrote:
> > I am talking abt a situation in which suppose the
> > process is running and monit is monitoring
> it....now i
> > try to restart the process through monit GUI by
> > pressing the "restart" button provided.In this
> case
> > whats the sequence of events which happen??
> 
> Monit will:
> - call stop method defined in monitrc by 'stop
> program ...'
> - wait for process to stop or timeout
> - call start method defined in monitrc by 'start
> program ...'
> - wait for process to start or timeout
> 
> When waiting for process to start, monit reads the
> pid from related file 
> and checks whether the process is running or not.
> 
> > 
> > This is the situation where im facing
> problems....as u
> > already know that my application doesnt generate a
> pid
> > file...i had manually created one for monit to
> > recognise it...hence it could monitor it
> easily...but
> > now when i try to restart the process through
> monit it
> > gives "execution failed".
> > 
> > I know that appending a line such as "pgrep
> myprocess
> > 
> >>..." to the application code would do..but for
> some
> > 
> > reasons i cant do it now.
> 
> The pidfile is mandatory for monit process
> monitoring
> 
> > 
> > Does monit look for the pid file first and then
> goes
> > on to execute the "start" method...or it does the
> > "start" and then the new pid is placed in the
> already
> > existing pid file?
> 
> the start method is responsible for updating the
> pidfile
> 
> > In short does monit have the capability to start a
> > process through itself when the user presses the
> > "start" button given that it doesnt have the pid
> of
> > the process??
> 
> As described above - the start method is responsible
> for starting the 
> process and updating the pidfile. Monit itself don't
> start the monitored 
> programs directly.
> 
> Martin
> 
> 
> 
> 
> --
> To unsubscribe:
>
http://lists.nongnu.org/mailman/listinfo/monit-general
> 



                
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com




reply via email to

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