<?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>Out of Control® &#187; How-To</title>
	<atom:link href="http://www.outofcontrol.ca/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.outofcontrol.ca</link>
	<description>Keeping you in control</description>
	<lastBuildDate>Mon, 19 Jul 2010 14:30:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apache: No space left on device: Cannot create SSLMutex</title>
		<link>http://www.outofcontrol.ca/2010/03/24/apache-no-space-left-on-device-cannot-create-sslmutex/</link>
		<comments>http://www.outofcontrol.ca/2010/03/24/apache-no-space-left-on-device-cannot-create-sslmutex/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 12:45:37 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[RHEL 5 plain]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sslmutex]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=247</guid>
		<description><![CDATA[Today, for the first time on one of our servers, I was unable to restart Apache. Running a configtest showed no errors, so something else was up. Looking in the Apache error logs, there was a line: "No space left on device: Cannot create SSLMutex". If you ever get this, chances are you are suffering [...]]]></description>
			<content:encoded><![CDATA[<p>Today, for the first time on one of our servers, I was unable to restart Apache. Running a configtest showed no errors, so something else was up. Looking in the Apache error logs, there was a line: "No space left on device: Cannot create SSLMutex".</p>
<p>If you ever get this, chances are you are suffering from Apache leaving a bunch of stray semaphore sets lying around after an attempted restart of apache. A semaphore in simple terms, is a lock on an operation. The fix, with many thanks to <a href="http://carlosrivero.com/fix-apache---no-space-left-on-device-couldnt-create-accept-lock">Carlos Rivero</a> solved my problem instantly. Note that his solution does not fix the root of the problem, rather it simply gets you going again.</p>
<p>In terminal do the following using the ipcs app, which according to the man pages "ipcs - report XSI interprocess communication facilities status" . The -s flag will show a list of semaphores sets:</p>
<div class="igBar"><span id="lcode-3"><a href="#" onclick="javascript:showPlainTxt('code-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-3">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ipcs -s | grep apache </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Most likely you will see a fairly large list here. You need too, and it is safe too, have these deleted. The following command will again do the trick:</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ipcs -s | grep apache | awk <span style="color:#CC0000;">' { print $2 } '</span> | xargs -n <span style="color:#800000;color:#800000;">1</span> ipcrm -s </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Note: If your apache is running as nobody or another user, be sure to substitute that other user in place of  <em>apache</em> above.</p>
<p>&lt;h2&gt;Cannot create SSLMutex solution&lt;/h2&gt;</p>
<p>At the heart of the problem, is most likely a poorly configured Apache server. By default, SSMutex is configured to the default setting, as it was on this one server of ours. If you read the Apache.org pages for <em>mod_ssl</em> configuration, they have this to say about the default setting:</p>
<p>&lt;pre&gt;</p>
<p>The following Mutex <em>types</em> are available:</p>
<p><code>none | no</code></p>
<p>This is the default where no Mutex is used at all. Use it at your own risk. But because currently the Mutex is mainly used for synchronizing write access to the SSL Session Cache you can live without it as long as you accept a sometimes garbled Session Cache. So it's not recommended to leave this the default. Instead configure a real Mutex.</p>
<p>&lt;/pre&gt;</p>
<p>There are of course optional configuration settings. At the very least, it is suggested that you set SSLMutex to <em>sem</em>, which will let Apache choose which SSLMutex type to use.</p>
<p>You will most likely find this setting in the ssl.conf file located at /etc/httpd/conf.d.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2010/03/24/apache-no-space-left-on-device-cannot-create-sslmutex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VMWare Fusion stuck at Shutting Down</title>
		<link>http://www.outofcontrol.ca/2009/12/07/vmware-fusion-stuck-at-shutting-down/</link>
		<comments>http://www.outofcontrol.ca/2009/12/07/vmware-fusion-stuck-at-shutting-down/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 17:09:59 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=241</guid>
		<description><![CDATA[This morning when I got to my Apple Mac Pro, I saw that VMWare Fusion, which had been running Window XP, was stuck at Shutting Down Windows. Presumably Windows decided to do an upgrade during the night and got stuck when it tried to reboot. Going to the menu 'Virtual Machine-&#62;Shut Down Guest' didn't do [...]]]></description>
			<content:encoded><![CDATA[<p>This morning when I got to my Apple Mac Pro, I saw that VMWare Fusion, which had been running Window XP, was stuck at Shutting Down Windows. Presumably Windows decided to do an upgrade during the night and got stuck when it tried to reboot.</p>
<p>Going to the menu 'Virtual Machine-&gt;Shut Down Guest' didn't do anything. The trick was to hold down the option key, which changes the Shut Down Guest to 'Power Off'. Selecting this worked fine.</p>
<p>Hope this tip helps someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/12/07/vmware-fusion-stuck-at-shutting-down/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash flaw puts most sites and users at risk</title>
		<link>http://www.outofcontrol.ca/2009/11/13/flash-flaw-puts-most-sites-and-users-at-risk/</link>
		<comments>http://www.outofcontrol.ca/2009/11/13/flash-flaw-puts-most-sites-and-users-at-risk/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 14:46:27 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=234</guid>
		<description><![CDATA[Computerworld is running a story on a significant security hole in Flash. The long and short of it all is that a security hole in Flash is in the wild, and is unpatchable according to Adobe. Mike Murray, the chief information security officer at Orlando, Fla.-based Foreground Security says "The best mitigation is to not use [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.computerworld.com/s/article/9140768/Flash_flaw_puts_most_sites_users_at_risk_say_researchers?taxonomyId=17&amp;pageNumber=2" target="_blank">Computerworld is running a story</a> on a significant security hole in Flash.</p>
<p>The long and short of it all is that a security hole in Flash is in the wild, and is unpatchable according to Adobe.</p>
<p>Mike Murray, the chief information security officer at Orlando, Fla.-based Foreground Security says "The best mitigation is to not use Flash, but we know that that's impossible for most users, since Flash is so widely used on the Web. Almost everyone using the Internet is vulnerable to a Web site that allows content to be updated inappropriately. That's not hyperbole, it's just fact. This has the potential to affect any social media site, any career site, any dating site, many retail sites and many cloud applications. That's why this attack is so serious. End users would never know they got exploited."</p>
<p>To read all about this, and how it might affect you, please take a moment to get educated and <a href="http://www.computerworld.com/s/article/9140768/Flash_flaw_puts_most_sites_users_at_risk_say_researchers?taxonomyId=17&amp;pageNumber=2" target="_blank">read the story at ComputerWorld.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/11/13/flash-flaw-puts-most-sites-and-users-at-risk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Code-breaker Turing should be pardoned</title>
		<link>http://www.outofcontrol.ca/2009/09/05/code-breaker-turing-should-be-pardoned/</link>
		<comments>http://www.outofcontrol.ca/2009/09/05/code-breaker-turing-should-be-pardoned/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 14:57:17 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=220</guid>
		<description><![CDATA[You most likely know who Alan Turing is, but did you know that wartime code-breaker Alan Turing was chemically castrated for admitting to his homosexuality and then mostly written out of history. Now, more than 26,000 people have signed a petition to the prime minister seeking a formal apology and posthumous pardon. Unfortunately the British [...]]]></description>
			<content:encoded><![CDATA[<p>You most likely know who Alan Turing is, but did you know that wartime code-breaker Alan Turing was chemically castrated for admitting to his homosexuality and then mostly written out of history. Now, more than 26,000 people have signed a petition to the prime minister seeking a formal apology and posthumous pardon. Unfortunately the British Government is ignoring this request, at least in public.</p>
<p>Travel with science editor Susan Watts to World War II code-breaking centre Bletchley Park. Visit where Turing worked to find out more about the man and speak to some of his relatives.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/09/05/code-breaker-turing-should-be-pardoned/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Metaweblog ExpressionEngine with Adobe Contribute</title>
		<link>http://www.outofcontrol.ca/2009/08/20/metaweblog-expressionengine-with-adobe-contribute/</link>
		<comments>http://www.outofcontrol.ca/2009/08/20/metaweblog-expressionengine-with-adobe-contribute/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 17:21:58 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=218</guid>
		<description><![CDATA[At a clients request I went about finding if there was a way to get Adobe Contribute to work with Expression Engine. As Contribute does use the Metaweblog API, it seemed that it should work. All my searching on Google though, led to dead end posts from people that didn't find a way to make [...]]]></description>
			<content:encoded><![CDATA[<p>At a clients request I went about finding if there was a way to get Adobe Contribute to work with Expression Engine. As Contribute does use the Metaweblog API, it seemed that it should work. All my searching on Google though, led to dead end posts from people that didn't find a way to make it work. </p>
<p>The solution is really quite simple. In Adobe's infinite wisdom, they don't allow parameters in the URL when trying to load the XMLRPC connection file. ExpressionEngine uses something like yoursite.com/index.php?ACT=10&#038;ID=1 as the way to connect. If you look at the server logs, Contribute will truncate your URL to just /index.php. </p>
<p>The solution is rather simeple, and requires only that you can modify your .htaccess file. Simply add a line like this:</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteEngine On</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteRule ^contribute.<span style="">xml</span> http:<span style="color:#FF9933; font-style:italic;">//www.yoursite.com/?ACT=10&amp;id=1 [P] </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The 'yoursite.com/?ACT=10&#038;id=1 should be replaced with whatever URL ExpressionEngine gives you after turning on, and setting up the Metaweblog API feature in ExpressionEngine Modules. For a complete how-to on setting this up, check out <a href="http://eeinsider.com/videos/show/using-external-editors-with-ee/">Ryan Irelan's excellent screencast on setting up external editors</a>. If you aren't familiar with <a href="http://www.eescreencasts.com/">Ryan's screencasts on ExpressionEngine</a>, now is the time to check those out too. At just $5 a pop, there is something for everyone in them. I have been using ExpressionEngine for two years and still learnt a lot of things. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/08/20/metaweblog-expressionengine-with-adobe-contribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying out links in WordPress Posts</title>
		<link>http://www.outofcontrol.ca/2009/08/12/displaying-out-links-in-wordpress-posts/</link>
		<comments>http://www.outofcontrol.ca/2009/08/12/displaying-out-links-in-wordpress-posts/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 15:25:57 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=216</guid>
		<description><![CDATA[A friend asked me to help him find all the out links from his Word Press blog. I came up with a little script to simply list all the WordPress entries and the URL's they contain. Thought others would like it too. It is not a WordPress plugin, and is simply provided as is to [...]]]></description>
			<content:encoded><![CDATA[<p>A friend asked me to <a href="http://forums.macosxhints.com/showthread.php?t=104297">help him find all the out links</a> from his Word Press blog. I came up with a little script to simply <a href="http://www.outofcontrol.ca/tools/myOutlinks.php">list all the WordPress entries and the URL's they contain</a>. Thought others would like it too. It is not a WordPress plugin, and is simply provided as is to help people quickly and easily find what links have been used in their own blogs. </p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/08/12/displaying-out-links-in-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress wp_category and wp_post2cat errors after upgrading</title>
		<link>http://www.outofcontrol.ca/2009/05/16/wordpress-wp_category-and-wp_post2cat-errors-after-upgrading/</link>
		<comments>http://www.outofcontrol.ca/2009/05/16/wordpress-wp_category-and-wp_post2cat-errors-after-upgrading/#comments</comments>
		<pubDate>Sat, 16 May 2009 18:18:09 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wp_category]]></category>
		<category><![CDATA[wp_post2cat]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=206</guid>
		<description><![CDATA[For those who get wp_category and wp-post2cat errors after upgrading WordPress, there is a solution. I noticed on the wordpress.org forums, a lot of people asking how to fix their plugins after they upgrade. The usual most common response I found was "show me your code, and I'll show you how to fix it." That [...]]]></description>
			<content:encoded><![CDATA[<p>For those who get wp_category and wp-post2cat errors after upgrading WordPress, there is a solution. I noticed on the wordpress.org forums, a lot of people asking how to fix their plugins after they upgrade. The usual most common response I found was "show me your code, and I'll show you how to fix it." That wasn't the answer I was looking for, and it would appear that lots of others weren't satisfied by that answer either. </p>
<p>If you have your own hand crafted WordPress plugins you wish to update, here is some useful information to help you:</p>
<p>1 - wp_category and wp_post2cat don't exist anymore. DO NOT recreate them, it will not help you.<br />
2 - WordPress now uses three new tables to replace the old tables: wp_terms, wp_term_relationships, wp_term_taxonomy.</p>
<p>Here is an example code that I had in one of my plugins:</p>
<div class="igBar"><span id="lcode-14"><a href="#" onclick="javascript:showPlainTxt('code-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-14">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SELECT cat_ID, count<span style="color:#006600; font-weight:bold;">&#40;</span>id<span style="color:#006600; font-weight:bold;">&#41;</span> as cat_counter,cat_name, category_parent FROM wp_category LEFT JOIN wp_post2cat AS pc ON <span style="color:#006600; font-weight:bold;">&#40;</span>cat_ID=category_id<span style="color:#006600; font-weight:bold;">&#41;</span> LEFT JOIN wp_posts ON ID=post_id AND post_status=<span style="color:#CC0000;">'publish'</span> AND post_type=<span style="color:#CC0000;">'post'</span> GROUP by cat_ID ORDER BY category_parent,cat_name </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here is the code after I updated it:</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">select t.<span style="">term_id</span> as cat_ID, count<span style="color:#006600; font-weight:bold;">&#40;</span>id<span style="color:#006600; font-weight:bold;">&#41;</span> as cat_counter,t.<span style="">name</span> as cat_name,tt.<span style="">parent</span> as category_parent FROM wp_terms as t left join wp_term_taxonomy as tt on t.<span style="">term_id</span>=tt.<span style="">term_id</span> left join wp_term_relationships as tr on <span style="color:#006600; font-weight:bold;">&#40;</span>tr.<span style="">term_taxonomy_id</span>=tt.<span style="">term_taxonomy_id</span><span style="color:#006600; font-weight:bold;">&#41;</span> left join wp_posts on wp_posts.<span style="">ID</span>=tr.<span style="">object_id</span> and tt.<span style="">taxonomy</span>=<span style="color:#CC0000;">'category'</span> AND post_status=<span style="color:#CC0000;">'publish'</span> AND post_type=<span style="color:#CC0000;">'post'</span> group by t.<span style="">term_id</span> order by category_parent, cat_name </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here is what I did to upgrade my plugin:<br />
1 - I didn't feel like rewriting tons of code, so where I had a table column in a select, I changed it to as tablename.column. For example, in the above example I needed cat_ID, cat_name and category_parent. The new names for those are wp_terms.term_id, wp_terms.name and wp_term_taxonomy.parent. By using wp_terms.term_id AS cat_ID, I would not have to modify any other code where I used cat_ID.<br />
2 - Instead of requiring two tables in the FROM section of a MySQL SELECT, I need three, which also means I needed to add an additional MySQL WHERE query also. To clarify this part, I am going to outline it here:</p>
<p>OLD FROM -> NEW FROM<br />
wp_category -> wp_terms<br />
wp_post2cat -> wp_term_relationships<br />
non-existent -> wp_term_taxonomy</p>
<p>New WHERE statements</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wp_category.<span style="">cat_ID</span>=wp_post2cat.<span style="">category</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
becomes</p>
<div class="igBar"><span id="lcode-17"><a href="#" onclick="javascript:showPlainTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wp_terms.<span style="">term_id</span>=wp_term_taxonomy.<span style="">term_id</span> AND wp_term_taxonomy.<span style="">term_taxonomy_id</span>=wp_term_relationship.<span style="">term_taxonomy_id</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And to fix the last relationship which will join the posts to the WordPress categories:</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wp_posts.<span style="">ID</span>=wp_post2cat.<span style="">post_id</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
becomes</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wp_posts.<span style="">ID</span>=wp_term_relationships.<span style="">object_id</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Note that you will need to add one last MySQL where clause. The reason for this last one, is that the taxonomy is no longer used just for categories. Since our old WordPress plugin we are updating was used for categories, we want to ensure we select just categories from our new tables.</p>
<p>Here is the one additional MySQL WHERE clause:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wp_term_taxonomy.<span style="">taxonomy</span>=<span style="color:#CC0000;">'category'</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Hopefully this will help someone out in their WordPress upgrade problem. If you see any errors in my code, or have any questions, post a comment. I usually try to check my comments regularly but I am worked to the gills right now, so I might not respond very quickly.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/05/16/wordpress-wp_category-and-wp_post2cat-errors-after-upgrading/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Beginners guide to su, sudo and sudoers</title>
		<link>http://www.outofcontrol.ca/2009/02/25/beginners-guide-to-su-sudo-and-sudoers/</link>
		<comments>http://www.outofcontrol.ca/2009/02/25/beginners-guide-to-su-sudo-and-sudoers/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 14:21:00 +0000</pubDate>
		<dc:creator>jriordon</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=192</guid>
		<description><![CDATA[I stumbled across this post today while looking for some specific sudo information. It is well written, with clearly described examples. If you are a sudo beginner then this article should help you out.]]></description>
			<content:encoded><![CDATA[<p>I stumbled across <a href="http://aplawrence.com/Basics/sudo.html">this post</a> today while looking for some specific sudo information. It is well written, with clearly described examples. If you are a sudo beginner then this article should help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/02/25/beginners-guide-to-su-sudo-and-sudoers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PECL geoip problem</title>
		<link>http://www.outofcontrol.ca/2009/02/10/installing-pecl-geoip-problem/</link>
		<comments>http://www.outofcontrol.ca/2009/02/10/installing-pecl-geoip-problem/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 14:08:20 +0000</pubDate>
		<dc:creator>plattapuss</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[RHEL 5 plain]]></category>
		<category><![CDATA[RHEL and Ensim]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=177</guid>
		<description><![CDATA[I needed the pecl package geoip installed on one of my RHEL5 servers running PHP 5. This is an easy task but you might get a slightly confusing error which will stop you. First off there are two ways to install a PECL package. First is to simply issue a pecl command at the prompt: [...]]]></description>
			<content:encoded><![CDATA[<p>I needed the pecl package geoip installed on one of my RHEL5 servers running PHP 5. This is an easy task but you might get a slightly confusing error which will stop you. </p>
<p>First off there are two ways to install a PECL package. First is to simply issue a pecl command at the prompt: pecl install geoip</p>
<p>Or, you can download the package and install it manually:</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showPlainTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd /tmp</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wget http:<span style="color:#FF9933; font-style:italic;">//pecl.php.net/get/geoip-1.0.6.tgz</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">tar -zxvf&nbsp; geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span>.<span style="">tgz</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpize</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">./configure</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">make</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">make install </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Either of these methods still requires you to add a file in /etc/php.d to enable the new package. For the geoip package you can add a file called geoip.ini to /etc/php.d</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showPlainTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">; Enable geoip extension module</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">extension=geoip.<span style="">so</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You can check quickly if geoip is installed by running 'php -r 'print_r(phpinfo());' | grep -i geoip' at the command line:</p>
<div class="igBar"><span id="lcode-27"><a href="#" onclick="javascript:showPlainTxt('code-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-27">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">19</span>:<span style="color:#800000;color:#800000;">27</span> root@server php.<span style="">d</span><span style="color:#006600; font-weight:bold;">&#93;</span># php -r <span style="color:#CC0000;">'print_r(phpinfo());'</span> | grep -i geoip </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">/etc/php.<span style="">d</span>/geoip.<span style="">ini</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">geoip</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">geoip support =&gt; enabled</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">geoip extension version =&gt; <span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">geoip library version =&gt; <span style="color:#800000;color:#800000;">1004005</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">geoip.<span style="">custom_directory</span> =&gt; no value =&gt; no value</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">OLDPWD =&gt; /tmp/geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_SERVER<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"OLDPWD"</span><span style="color:#006600; font-weight:bold;">&#93;</span> =&gt; /tmp/geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"OLDPWD"</span><span style="color:#006600; font-weight:bold;">&#93;</span> =&gt; /tmp/geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If there is no output, then you have done something wrong and geoip is not installed.</p>
<p>However, if you get something like this:</p>
<div class="igBar"><span id="lcode-28"><a href="#" onclick="javascript:showPlainTxt('code-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-28">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">07</span>:<span style="color:#800000;color:#800000;">57</span>:<span style="color:#800000;color:#800000;">57</span> root@server geoip-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#93;</span># ./configure</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for egrep... <span style="">grep</span> -E</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for a sed that does not truncate output... /bin/sed</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for gcc... <span style="">gcc</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for C compiler default output file name... <span style="">a</span>.<span style="">out</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking whether the C compiler works... <span style="">yes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking whether we are cross compiling... <span style="">no</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for suffix of executables... </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">checking</span> for suffix of object files... <span style="">o</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking whether we are using the GNU C compiler... <span style="">yes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking whether gcc accepts -g... <span style="">yes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for gcc option to accept ANSI C... <span style="">none</span> needed</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking whether gcc and cc understand -c and -o together... <span style="">yes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking if compiler supports -R... <span style="">no</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking if compiler supports -Wl,-rpath,... <span style="">yes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking build system type... <span style="">i686</span>-redhat-linux-gnu</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking host system type... <span style="">i686</span>-redhat-linux-gnu</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking target system type... <span style="">i686</span>-redhat-linux-gnu</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for PHP prefix... /usr</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for PHP extension directory... /usr/lib/php/modules</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for PHP installed headers prefix... /usr/include/php</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for re2c... <span style="">no</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">configure: WARNING: You will need re2c <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">9</span>.<span style="color:#800000;color:#800000;">11</span> or later if you want to regenerate PHP parsers.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">checking</span> for gawk... <span style="">gawk</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for geoip support... <span style="">yes</span>, shared</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">checking for geoip files in default path... <span style="">not</span> found</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">configure: error: Please reinstall the geoip distribution </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You might scratch your head and say to yourself, but I am trying to install the geoip distribution, what gives? What the PECL package is looking for is the geoip-devel rpm. Simply issue yum install geoip-devel at the prompt, then go ahead with one of the above methods of installing the PECL geoip package. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2009/02/10/installing-pecl-geoip-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging MailScanner: cleaning messages</title>
		<link>http://www.outofcontrol.ca/2008/12/19/debugging-mailscanner-cleaning-messages/</link>
		<comments>http://www.outofcontrol.ca/2008/12/19/debugging-mailscanner-cleaning-messages/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 15:01:53 +0000</pubDate>
		<dc:creator>plattapuss</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[anti-virus]]></category>
		<category><![CDATA[mailscanner]]></category>

		<guid isPermaLink="false">http://www.outofcontrol.ca/?p=167</guid>
		<description><![CDATA[Last week I did a short post on testing MailScanner to be sure it was scanning properly. An alert reader pointed out that I missed the easy solution, which was to simply use 'MailScanner --lint' to check if MailScanner was running properly. Since I wrote that article, I found that my MailScanner was again hogging [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.outofcontrol.ca/2008/12/16/test-your-servers-virus-filters-dont-assume/">Last week</a> I did a short post on testing MailScanner to be sure it was scanning properly. An alert reader pointed out that I missed the easy solution, which was to simply use 'MailScanner --lint' to check if MailScanner was running properly.</p>
<p>Since I wrote that article, I found that my MailScanner was again hogging the CPU. Last time it was an issue with f-prot interaction, this time it is a problem apparently with MailScanner. </p>
<p>Here is what I did to debug this issue, and <a href="http://thread.gmane.org/gmane.mail.virus.mailscanner/67315/focus=67326">here is the post</a> that helped me learn more about MailScanner.</p>
<p>First thing was to check top:</p>
<div class="igBar"><span id="lcode-35"><a href="#" onclick="javascript:showPlainTxt('code-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-35">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">7078</span> root&nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">25</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">28936</span>&nbsp; 23m <span style="color:#800000;color:#800000;">1960</span> R&nbsp; &nbsp;<span style="color:#800000;color:#800000;">99</span>&nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">6</span>&nbsp; &nbsp;<span style="color:#800000;color:#800000;">3</span>:<span style="color:#800000;color:#800000;">19</span>.<span style="color:#800000;color:#800000;">60</span> MailScanner </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>When I did a strace -p 7078 I saw nothing. Literally. So that was not much help. Next up, see what ps has for me:</p>
<div class="igBar"><span id="lcode-36"><a href="#" onclick="javascript:showPlainTxt('code-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-36">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ps -ax | grep MailScanner</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">07</span>:<span style="color:#800000;color:#800000;">40</span>:<span style="color:#800000;color:#800000;">59</span> root@secure site1<span style="color:#006600; font-weight:bold;">&#93;</span># ps ax | grep MailScanner</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7077</span> ?&nbsp; &nbsp; &nbsp; &nbsp; Ss&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span> MailScanner: master waiting for children, sleeping</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7078</span> ?&nbsp; &nbsp; &nbsp; &nbsp; R&nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">14</span>:<span style="color:#800000;color:#800000;">43</span> MailScanner: cleaning messages</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7085</span> ?&nbsp; &nbsp; &nbsp; &nbsp; S&nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span> MailScanner: waiting for messages</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7123</span> ?&nbsp; &nbsp; &nbsp; &nbsp; S&nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span> MailScanner: waiting for messages</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7127</span> ?&nbsp; &nbsp; &nbsp; &nbsp; S&nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span> MailScanner: waiting for messages</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#800000;color:#800000;">7170</span> ?&nbsp; &nbsp; &nbsp; &nbsp; S&nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>:<span style="color:#800000;color:#800000;">00</span> MailScanner: waiting for messages </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>There is my stuck process, and apparently it is stuck cleaning messages. But which messages? The MailScanner working directory has more than one email in it, and to be picky I would prefer not to delete a valid email. Next step to be thorough is to do an strace on MailScanner itself and see what it is up to. You will see a lot of output, and then finally you should see a list of PID's coupled with the email that is stuck:</p>
<div class="igBar"><span id="lcode-37"><a href="#" onclick="javascript:showPlainTxt('code-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-37">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">strace -f /usr/sbin/MailScanner</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJAmQ7J011131"</span>, O_RDWR|O_LARGEFILE<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">7</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> ioctl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf558<span style="color:#006600; font-weight:bold;">&#41;</span> = -<span style="color:#800000;color:#800000;">1</span> ENOTTY <span style="color:#006600; font-weight:bold;">&#40;</span>Inappropriate ioctl for device<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> _llseek<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, <span style="color:#800000;color:#800000;">0</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>, SEEK_CUR<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> fstat64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>st_mode=S_IFREG|<span style="color:#800000;color:#800000;">0600</span>, st_size=<span style="color:#800000;color:#800000;">1182</span>, ...<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> fcntl64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, F_SETFD, FD_CLOEXEC<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> fcntl64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, F_SETLK64, <span style="color:#006600; font-weight:bold;">&#123;</span>type=F_WRLCK, whence=SEEK_SET, start=<span style="color:#800000;color:#800000;">0</span>, len=<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span>, 0x99a50a8<span style="color:#006600; font-weight:bold;">&#41;</span> = -<span style="color:#800000;color:#800000;">1</span> EAGAIN <span style="color:#006600; font-weight:bold;">&#40;</span>Resource temporarily unavailable<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> close<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>pid <span style="color:#800000;color:#800000;">24167</span><span style="color:#006600; font-weight:bold;">&#93;</span> open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJE3lHG021993"</span>, O_RDWR|O_LARGEFILE<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">7</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Note the different PID on these files that seem to cause MailScanner to loop indefinitely: [pid 24167]. Now we can run a trace on that PID:</p>
<div class="igBar"><span id="lcode-38"><a href="#" onclick="javascript:showPlainTxt('code-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-38">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">strace -p <span style="color:#800000;color:#800000;">24167</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJAmQ7J011131"</span>, O_RDWR|O_LARGEFILE<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">7</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ioctl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfddf558<span style="color:#006600; font-weight:bold;">&#41;</span> = -<span style="color:#800000;color:#800000;">1</span> ENOTTY <span style="color:#006600; font-weight:bold;">&#40;</span>Inappropriate ioctl for device<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">_llseek<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, <span style="color:#800000;color:#800000;">0</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>, SEEK_CUR<span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fstat64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>st_mode=S_IFREG|<span style="color:#800000;color:#800000;">0600</span>, st_size=<span style="color:#800000;color:#800000;">1182</span>, ...<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fcntl64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, F_SETFD, FD_CLOEXEC<span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fcntl64<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span>, F_SETLK64, <span style="color:#006600; font-weight:bold;">&#123;</span>type=F_WRLCK, whence=SEEK_SET, start=<span style="color:#800000;color:#800000;">0</span>, len=<span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span>, 0x99a50a8<span style="color:#006600; font-weight:bold;">&#41;</span> = -<span style="color:#800000;color:#800000;">1</span> EAGAIN <span style="color:#006600; font-weight:bold;">&#40;</span>Resource temporarily unavailable<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">close<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">7</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJE3lHG021993"</span>, O_RDWR|O_LARGEFILE<span style="color:#006600; font-weight:bold;">&#41;</span> = <span style="color:#800000;color:#800000;">7</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now we will get more looping text, but this time it will show the emails that MailScanner is stuck  on:</p>
<div class="igBar"><span id="lcode-39"><a href="#" onclick="javascript:showPlainTxt('code-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-39">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJAmQ7J011131</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">/home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/qfmBJE3lHG021993 </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>While MailScanner is still running, you can go to the MailScanner working directory and see a list of folders named after the MailScanner PID's:</p>
<div class="igBar"><span id="lcode-40"><a href="#" onclick="javascript:showPlainTxt('code-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-40">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cd /home/virtual/FILESYSTEMTEMPLATE/services/mailscanner/MailScanner.<span style="">work</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">53</span>:<span style="color:#800000;color:#800000;">51</span> root@secure MailScanner.<span style="">work</span><span style="color:#006600; font-weight:bold;">&#93;</span># ls -la</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">total <span style="color:#800000;color:#800000;">28</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">drwx------ <span style="color:#800000;color:#800000;">7</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">13</span> .</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">drwxr</span>-xr-x <span style="color:#800000;color:#800000;">4</span> root root <span style="color:#800000;color:#800000;">4096</span> Mar <span style="color:#800000;color:#800000;">20</span>&nbsp; <span style="color:#800000;color:#800000;">2008</span> ..</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">drwx</span>------ <span style="color:#800000;color:#800000;">2</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">39</span> <span style="color:#800000;color:#800000;">24167</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">drwx------ <span style="color:#800000;color:#800000;">2</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">46</span> <span style="color:#800000;color:#800000;">26134</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">drwx------ <span style="color:#800000;color:#800000;">2</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">29</span> <span style="color:#800000;color:#800000;">26135</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">drwx------ <span style="color:#800000;color:#800000;">2</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">46</span> <span style="color:#800000;color:#800000;">26136</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">drwx------ <span style="color:#800000;color:#800000;">2</span> root root <span style="color:#800000;color:#800000;">4096</span> Dec <span style="color:#800000;color:#800000;">19</span> <span style="color:#800000;color:#800000;">08</span>:<span style="color:#800000;color:#800000;">47</span> <span style="color:#800000;color:#800000;">26137</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Go into the problem PID's directory and you will see a list of files that make up the email that is stuck. This might help you determine why the email is stuck. In my case, there was a virus attached to an email, which, <a href="http://thread.gmane.org/gmane.mail.virus.mailscanner/67315/focus=67326">like the this post pointed out</a>, was also causing MailScanner to loop. </p>
<p>Yes, you can easily just go to /home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue/ and delete all the emails in the queue and restart MailScanner, but I wanted to be sure that one of the emails was really the problem.</p>
<p>This little how-to does not fix the real issue of MailScanner getting stuck in an endless loop, but merely solves the current issue of MailScanner hogging the CPU. We can fully expect the issue to rear its ugly little head again at some point. Hopefully by that time, we will have solved the root issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outofcontrol.ca/2008/12/19/debugging-mailscanner-cleaning-messages/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
