<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Racker Hacker &#187; sigstop</title>
	<atom:link href="http://rackerhacker.com/tag/sigstop/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Wed, 16 May 2012 12:55:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Two great signals: SIGSTOP and SIGCONT</title>
		<link>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/</link>
		<comments>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:16:19 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[sigcont]]></category>
		<category><![CDATA[signals]]></category>
		<category><![CDATA[sigstop]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=920</guid>
		<description><![CDATA[The best uses I've found for the SIGSTOP and SIGCONT signals are times when a process goes haywire, or when a script spawns too many processes at once. You can issue the signals like this: kill -SIGSTOP [pid] kill -SIGCONT [pid] Wikipedia has great definitions for SIGSTOP: When SIGSTOP is sent to a process, the [...]<p><a href="http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/">Two great signals: SIGSTOP and SIGCONT</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>The best uses I've found for the SIGSTOP and SIGCONT signals are times when a process goes haywire, or when a script spawns too many processes at once.</p>
<p>You can issue the signals like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kill -SIGSTOP [pid]
kill -SIGCONT [pid]</pre></div></div>

<p>Wikipedia has great definitions for <a href="http://en.wikipedia.org/wiki/SIGSTOP">SIGSTOP</a>:</p>
<blockquote><p>When SIGSTOP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes. SIGSTOP cannot be caught or ignored.</p></blockquote>
<p>and <a href="http://en.wikipedia.org/wiki/SIGCONT">SIGCONT</a>:</p>
<blockquote><p>When SIGSTOP or SIGTSTP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes.</p></blockquote>
<p>In short, SIGSTOP tells a process to "hold on" and SIGCONT tells a process to "pick up where you left off".  This can work really well for rsync jobs since you can pause the job, clear up some space on the destination device, and then resume the job.  The source rsync process just thinks that the destination rsync process is taking a long time to respond.</p>
<p>In the <code>ps</code> output, stopped processes will have a status containing <em>T</em>.  Here's an example with <code>crond</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># kill -SIGSTOP `pgrep crond`
# ps aufx | grep crond
root      3499  0.0  0.0 100328  1236 ?        Ts   Jun11   0:01 crond
# kill -SIGCONT `pgrep crond`
# ps aufx | grep crond
root      3499  0.0  0.0 100328  1236 ?        Ss   Jun11   0:01 crond</pre></div></div>

<p><a href="http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/">Two great signals: SIGSTOP and SIGCONT</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

