<?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"
	>
<channel>
	<title>Comments on: How to run terracotta as a service</title>
	<atom:link href="http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/feed/" rel="self" type="application/rss+xml" />
	<link>http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 06 Jan 2009 04:56:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Stefan F</title>
		<link>http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/#comment-45</link>
		<dc:creator>Stefan F</dc:creator>
		<pubDate>Thu, 17 Jul 2008 08:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.richard-wilkinson.co.uk/?p=33#comment-45</guid>
		<description>Nice article. Actually, I did the same (at least similarly, actually not as nice as you did it) and forgot to write about it. Damn ...

However, there is a better way to run commands in the background than using `nohup`. I was lucky enough that a work mate shared his geek skills with me and I am glad to share mine with others: ;)

If I remember, nohup is a wrapper that catches and ignores SIGHUP signals, which is not what you want if you need your services to shut down smoothly.

The problem people normally try to solve is that the shell kills all its running jobs when closing (sending SIGHUP to all processes). To avoid this, you just have to decouple a running process from the shell. Using bash, there are some (I think) not very well known commands that do a great job: `fg` (get background job to foreground), `bg` (decouple background job), `jobs` (list background jobs) (just to name those I use most).

With terracotta, this would be:

`start-terracotta-command.sh &#38; bg`

Or try `start-terracotta-command.sh &#38; jobs; bg; jobs`

Terracotta goes to the background, won't close when you close your bash session, and shuts down smoothly when you ask it to using SIGHUP.

See "JOB CONTROL" section in `man bash` for details</description>
		<content:encoded><![CDATA[<p>Nice article. Actually, I did the same (at least similarly, actually not as nice as you did it) and forgot to write about it. Damn &#8230;</p>
<p>However, there is a better way to run commands in the background than using `nohup`. I was lucky enough that a work mate shared his geek skills with me and I am glad to share mine with others: <img src='http://richard-wilkinson.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
If I remember, nohup is a wrapper that catches and ignores SIGHUP signals, which is not what you want if you need your services to shut down smoothly.</p>
<p>The problem people normally try to solve is that the shell kills all its running jobs when closing (sending SIGHUP to all processes). To avoid this, you just have to decouple a running process from the shell. Using bash, there are some (I think) not very well known commands that do a great job: `fg` (get background job to foreground), `bg` (decouple background job), `jobs` (list background jobs) (just to name those I use most).</p>
<p>With terracotta, this would be:</p>
<p>`start-terracotta-command.sh &amp; bg`</p>
<p>Or try `start-terracotta-command.sh &amp; jobs; bg; jobs`</p>
<p>Terracotta goes to the background, won&#8217;t close when you close your bash session, and shuts down smoothly when you ask it to using SIGHUP.</p>
<p>See &#8220;JOB CONTROL&#8221; section in `man bash` for details</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/#comment-46</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 13 Jul 2008 16:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.richard-wilkinson.co.uk/?p=33#comment-46</guid>
		<description>~&gt;Sue, thanks :)

~&gt;Blake, thanks, glad you found it useful, I haven't tried it on solaris, but I imagine that it should work just as well as on linux.

Richard</description>
		<content:encoded><![CDATA[<p>~>Sue, thanks <img src='http://richard-wilkinson.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
~>Blake, thanks, glad you found it useful, I haven&#8217;t tried it on solaris, but I imagine that it should work just as well as on linux.</p>
<p>Richard</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blake Dworaczyk</title>
		<link>http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/#comment-44</link>
		<dc:creator>Blake Dworaczyk</dc:creator>
		<pubDate>Fri, 11 Jul 2008 23:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.richard-wilkinson.co.uk/?p=33#comment-44</guid>
		<description>Excellent instructions. I'll need to deploy my terracotta-based research framework and this looks like the 'correct' way to run this as a service (I'm on Solaris 10).</description>
		<content:encoded><![CDATA[<p>Excellent instructions. I&#8217;ll need to deploy my terracotta-based research framework and this looks like the &#8216;correct&#8217; way to run this as a service (I&#8217;m on Solaris 10).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sue Massey</title>
		<link>http://richard-wilkinson.co.uk/2008/07/11/how-to-run-terracotta-as-a-service/#comment-43</link>
		<dc:creator>Sue Massey</dc:creator>
		<pubDate>Fri, 11 Jul 2008 13:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.richard-wilkinson.co.uk/?p=33#comment-43</guid>
		<description>Nice writing style. I look forward to reading more in the future.</description>
		<content:encoded><![CDATA[<p>Nice writing style. I look forward to reading more in the future.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
