tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaji Thomas" <ShTho...@ariba.com>
Subject RE: How to make Tomcat shutdown itself if the address it is trying to bind is already in use.
Date Wed, 28 Nov 2007 22:26:42 GMT
Thank you Gregor for the suggestion. 
I was trying to see if there is a way to do this from within my
application code which is running under Tomcat. The issue is that I
don't have direct control over the scripts that start Tomcat. 

Thanks
Shaji

-----Original Message-----
From: Gregor Schneider [mailto:rc46fi@googlemail.com] 
Sent: Wednesday, November 28, 2007 8:10 AM
To: Tomcat Users List
Subject: Re: How to make Tomcat shutdown itself if the address it is
trying to bind is already in use.

if [ -z "$(netstat -lnp | grep 8080)" ]
then
    echo "Tomcat running"
    exit -1
else
    [ continue with startup-script ]
fi

do the same for port 8009 (AJP)

however, the best way would be to first check if tomcat is running
before starting it up....

remember:

a fool with a tool is still a fool...

gregor


-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message