<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to automatically recover Tomcat from crashes</title>
	<atom:link href="http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=howto-auto-recover-tomcat-crashes</link>
	<description>Java, Web 2.0 and other Tech topics</description>
	<lastBuildDate>Thu, 09 Feb 2012 08:01:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: vineet</title>
		<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/comment-page-1/#comment-6903</link>
		<dc:creator>vineet</dc:creator>
		<pubDate>Tue, 29 Jun 2010 15:36:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1108#comment-6903</guid>
		<description>Good points, Rob. I use Tomcat in dev, test and production environments. I use this script in dev and test, but not in production - simply because my production tomcat has never crashed. I suspect the reason for more frequent crashes on is lesser memory on dev and test machines and high frequency of hot deploys.

I use a version of the script which notifies me when it restarts tomcat.
&lt;code&gt;
SERVICE=/etc/init.d/tomcat
STOPPED_MESSAGE=&quot;Tomcat Servlet Container is not running.&quot;

if [ &quot;`$SERVICE status`&quot; == &quot;$STOPPED_MESSAGE&quot;];
then
{
  $SERVICE start
  mail -s &quot;Tomcat was down on `hostname`, restarting...&quot; admin@email.address
}
fi
&lt;/code&gt;
While this takes care of the symptom right away, it also alerts you so that you can investigate the root cause.</description>
		<content:encoded><![CDATA[<p>Good points, Rob. I use Tomcat in dev, test and production environments. I use this script in dev and test, but not in production &#8211; simply because my production tomcat has never crashed. I suspect the reason for more frequent crashes on is lesser memory on dev and test machines and high frequency of hot deploys.</p>
<p>I use a version of the script which notifies me when it restarts tomcat.<br />
<code><br />
SERVICE=/etc/init.d/tomcat<br />
STOPPED_MESSAGE="Tomcat Servlet Container is not running."</p>
<p>if [ "`$SERVICE status`" == "$STOPPED_MESSAGE"];<br />
then<br />
{<br />
  $SERVICE start<br />
  mail -s "Tomcat was down on `hostname`, restarting..." <a href="mailto:admin@email.address">admin@email.address</a><br />
}<br />
fi<br />
</code><br />
While this takes care of the symptom right away, it also alerts you so that you can investigate the root cause.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Blake</title>
		<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/comment-page-1/#comment-6896</link>
		<dc:creator>Rob Blake</dc:creator>
		<pubDate>Tue, 29 Jun 2010 08:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1108#comment-6896</guid>
		<description>I understand the logic of wanting to use a script like this, but I do wonder if in doing so, you end up treating the symptoms rather than addressing the cause of the problem? 

From a business point of view, if the technology I am using in production keeps crashing I would want to know how often this occurs, what I am doing to cause the crashes and whether these two in combination warrant me investigating the use of alternate technologies? Is this script something that you have/would use in production, or is it something you think that is useful for individual developers?

What are your thoughts about how this could be integrated into a wider monitoring solution so that technical issues are not masked from the business?</description>
		<content:encoded><![CDATA[<p>I understand the logic of wanting to use a script like this, but I do wonder if in doing so, you end up treating the symptoms rather than addressing the cause of the problem? </p>
<p>From a business point of view, if the technology I am using in production keeps crashing I would want to know how often this occurs, what I am doing to cause the crashes and whether these two in combination warrant me investigating the use of alternate technologies? Is this script something that you have/would use in production, or is it something you think that is useful for individual developers?</p>
<p>What are your thoughts about how this could be integrated into a wider monitoring solution so that technical issues are not masked from the business?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/comment-page-1/#comment-6885</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 28 Jun 2010 16:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1108#comment-6885</guid>
		<description>Thanks

You can also test like this:

return_string = $(jps &#124; grep Bootstrap)
if [-n &quot;$return_string&quot; ]; then ....</description>
		<content:encoded><![CDATA[<p>Thanks</p>
<p>You can also test like this:</p>
<p>return_string = $(jps | grep Bootstrap)<br />
if [-n "$return_string" ]; then &#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sapporo</title>
		<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/comment-page-1/#comment-6883</link>
		<dc:creator>sapporo</dc:creator>
		<pubDate>Mon, 28 Jun 2010 13:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1108#comment-6883</guid>
		<description>Instead of re-inventing the wheel, you could also use Tanuki Java Service Wrapper (open source/commercial), Yet Another Java Service Wrapper (open source), or Apache Commons Daemon (procrun on Windows or jsvc on Linux, both open source).</description>
		<content:encoded><![CDATA[<p>Instead of re-inventing the wheel, you could also use Tanuki Java Service Wrapper (open source/commercial), Yet Another Java Service Wrapper (open source), or Apache Commons Daemon (procrun on Windows or jsvc on Linux, both open source).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh</title>
		<link>http://www.vineetmanohar.com/2010/06/howto-auto-recover-tomcat-crashes/comment-page-1/#comment-6871</link>
		<dc:creator>Ramesh</dc:creator>
		<pubDate>Mon, 28 Jun 2010 03:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/?p=1108#comment-6871</guid>
		<description>better yet... use monit (http://mmonit.com/monit/)</description>
		<content:encoded><![CDATA[<p>better yet&#8230; use monit (<a href="http://mmonit.com/monit/" rel="nofollow">http://mmonit.com/monit/</a>)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

