----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Chris and Duane. What we do is have a simple Monitor.java class which
simply returns the text "success". Then we have a cron job run curl to
check whether the whole apache-jserv shebang is responding. If not, then we
kick the individual JServ process. (We run JServ in manual mode.)
We're running a load balanced set of JServ processes, so we play some tricks
with having dummy virtual hosts set up just for monitoring, so that we can
tell which Jserv process among those in the pool are having problems.
We never, ever, ever, need to restart the apache process.
I can tell you more about this in detail if you'd like.
jae
> -----Original Message-----
> From: Duane Gran [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 28, 2000 11:29 AM
> To: Java Apache Users
> Subject: Re: Cron monitoring JServ
>
>
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files. Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> > Does anyone have a nice script to check Jserv is running, and if not
> > restart it? Something to add to my crontab.
>
> Chris,
>
> I use the following script on my system, run as root, to
> detect an error
> in the logs and restart apache gracefully. I'm not very proud of the
> script, and would prefer a way of restarting the JVM instead of the
> whole server, so suggestions are welcome.
>
> Duane Gran
> http://www.spinweb.net -- Servlet Hosting
>
> #!/bin/ksh
>
> restart_cmd='/usr/local/apache/bin/apachectl graceful'
> error_msg='java.lang.ArrayIndexOutOfBoundsException'
> Date=`date +%D`
> Time=`date +%T`
>
> output=`tail -20 /usr/local/jserv/logs/jserv.log | grep $error_msg`
> if [[ $output != "" ]]; then
> $restart_cmd # restart web server
> echo "$Date $Time: Restarting server" >>
> /usr/local/jserv/logs/serverCheck.log
> fi
>
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives and Other: <http://java.apache.org/main/mail.html>
> Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]