<?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>Pervasive Code &#187; Linux</title>
	<atom:link href="http://www.pervasivecode.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Mon, 26 Jul 2010 05:29:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unix tip: kill -STOP and kill -CONT</title>
		<link>http://www.pervasivecode.com/blog/2010/04/03/unix-tip-kill-stop-and-kill-cont/</link>
		<comments>http://www.pervasivecode.com/blog/2010/04/03/unix-tip-kill-stop-and-kill-cont/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 01:31:44 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=194</guid>
		<description><![CDATA[Pretty much every Unix user knows about the kill command, and most know about &#8216;kill -KILL&#8217; aka &#8216;kill -9&#8242;.
But do you know about kill -STOP and kill -CONT?

I&#8217;m not sure of the exact mechanism (kernel vs. user process) but everything I&#8217;ve used it on on a Mac OS X machine has responded to it in [...]]]></description>
			<content:encoded><![CDATA[<p>Pretty much every Unix user knows about the kill command, and most know about &#8216;kill -KILL&#8217; aka &#8216;kill -9&#8242;.</p>
<p>But do you know about kill -STOP and kill -CONT?<br />
<span id="more-194"></span><br />
I&#8217;m not sure of the exact mechanism (kernel vs. user process) but everything I&#8217;ve used it on on a Mac OS X machine has responded to it in the same way. So you may find a process that doesn&#8217;t do this, but I haven&#8217;t found one.</p>
<p>Basically <code>kill -STOP 1234</code> will pause the process with pid 1234, and <code>kill -CONT 1234</code> will resume it. It&#8217;s as if you can sleep individual applications instead of your entire computer.</p>
<p>It&#8217;s simple, but you can probably imagine why this would be useful. Want to keep Firefox with 45 tabs open, but you&#8217;re not using it for a while and you want to save battery life? Pause it. Pretty much anything like &#8220;I don&#8217;t want to quit and then re-launch this but I wish it wasn&#8217;t using a bunch of CPU time while it idles&#8221; is a good candidate.</p>
<p>Remember that this means your app my time out when it is resumed, as if you had slept your laptop. So network connections it had open when you paused it may be broken when you resume it. So pausing Terminal.app with a bunch of open ssh connections to remote servers isn&#8217;t going to work too well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2010/04/03/unix-tip-kill-stop-and-kill-cont/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Karmic on Xen with Bad /etc/fstab = PAIN</title>
		<link>http://www.pervasivecode.com/blog/2010/02/07/karmic-on-xen-with-bad-etcfstab-pain/</link>
		<comments>http://www.pervasivecode.com/blog/2010/02/07/karmic-on-xen-with-bad-etcfstab-pain/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 00:32:20 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=156</guid>
		<description><![CDATA[Argh! I spent about 5 hours yesterday troubleshooting a failed Ubuntu Jaunty -> Karmic (9.04->9.10) upgrade. It worked fine until I rebooted and then failed to boot. Here&#8217;s how I fixed it.

It failed to boot, saying this:

One or more mounts listed in /etc/fstab cannot yet be mounted
/ : waiting for /dev/xvda1
/tmp : waiting for (null)
/swap [...]]]></description>
			<content:encoded><![CDATA[<p>Argh! I spent about 5 hours yesterday troubleshooting a failed Ubuntu Jaunty -> Karmic (9.04->9.10) upgrade. It worked fine until I rebooted and then failed to boot. Here&#8217;s how I fixed it.<br />
<span id="more-156"></span><br />
It failed to boot, saying this:<br />
<code><br />
One or more mounts listed in /etc/fstab cannot yet be mounted<br />
/ : waiting for /dev/xvda1<br />
/tmp : waiting for (null)<br />
/swap : waiting for /dev/xvda9<br />
</code></p>
<p>I tried a lot of stuff and finally solved it. My solution is on the Ubuntu Forum, here: <a href="http://ubuntuforums.org/showpost.php?p=8789500&#038;postcount=37">One or more of the mounts listed in /etc/fstab/ cannot yet be mounted (Karmic)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2010/02/07/karmic-on-xen-with-bad-etcfstab-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.10 (Jaunty Jackalope) upgrade notes</title>
		<link>http://www.pervasivecode.com/blog/2010/02/06/ubuntu-910-jaunty-jackalope-upgrade-notes/</link>
		<comments>http://www.pervasivecode.com/blog/2010/02/06/ubuntu-910-jaunty-jackalope-upgrade-notes/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 04:24:57 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=154</guid>
		<description><![CDATA[Once again Ubuntu Linux proves itself to be easy to upgrade. Going from 9.04 to 9.10 (one release newer, since their numbering is bsaed on dates) was easy, but included the standard sprinkling of manual re-customization that I&#8217;ve come to expect from Debian based systems.

I did the Network Upgrade for Servers.
I had to re-customize these [...]]]></description>
			<content:encoded><![CDATA[<p>Once again Ubuntu Linux proves itself to be easy to upgrade. Going from 9.04 to 9.10 (one release newer, since their numbering is bsaed on dates) was easy, but included the standard sprinkling of manual re-customization that I&#8217;ve come to expect from Debian based systems.<br />
<span id="more-154"></span><br />
I did the <a href="https://help.ubuntu.com/community/KarmicUpgrades#Network%20Upgrade%20for%20Ubuntu%20Servers%20%28Recommended%29">Network Upgrade for Servers</a>.</p>
<p>I had to re-customize these files since I&#8217;m not running with 100% default configuration:</p>
<p>/etc/monit/monit<br />
/etc/monit/monitrc<br />
/etc/dovecot/dovecot.conf<br />
/etc/apache2/apache2.conf<br />
/etc/php/apache2/php.ini</p>
<p>I basically did a manual diff side by side in Emacs and copied my changes over into the new config files. Reboot, no problems. Nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2010/02/06/ubuntu-910-jaunty-jackalope-upgrade-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.10 and 9.04 (Intrepid Ibex and Jaunty Jackalope) upgrade notes</title>
		<link>http://www.pervasivecode.com/blog/2009/05/30/ubuntu-jaunty-jackalope-upgrade-notes/</link>
		<comments>http://www.pervasivecode.com/blog/2009/05/30/ubuntu-jaunty-jackalope-upgrade-notes/#comments</comments>
		<pubDate>Sat, 30 May 2009 22:54:18 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=96</guid>
		<description><![CDATA[I&#8217;m at WordCamp San Francisco today and decided that running a year old version of WordPress (on a year old version of Ubuntu Linux) was undesirable. So, with the confidence that comes from many relatively easy Ubuntu OS upgrades, I charged ahead. For (I think) the second time ever, things went badly. Here&#8217;s what I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m at <a href="http://2009.sf.wordcamp.org/">WordCamp San Francisco</a> today and decided that running a year old version of WordPress (on a year old version of <a href="http://www.ubuntu.com/">Ubuntu Linux</a>) was undesirable. So, with the confidence that comes from many relatively easy Ubuntu OS upgrades, I charged ahead. For (I think) the second time ever, things went badly. Here&#8217;s what I did and how I fixed it.<br />
<span id="more-96"></span><br />
First, I had to figure out what release of Ubuntu was currently installed:<br />
<code>lsb_release -a</code></p>
<p>I was on &#8220;hardy&#8221;, a.k.a. the <a href="https://wiki.ubuntu.com/HardyHeron/">Hardy Heron</a> release, a.k.a. Ubuntu 8.04 LTS.</p>
<p>I had not bothered to install <a href="https://wiki.ubuntu.com/IntrepidIbex/">Ubuntu 8.10 / &#8220;Intrepid Ibex&#8221;</a> because I didn&#8217;t have a reason to when it was release. I now wanted to upgrade to <a href="https://wiki.ubuntu.com/JauntyJackalope">Ubuntu 9.04 &#8220;Jaunty Jackalope&#8221;</a> which has <a href="http://wordpress.org/">WordPress</a> 2.7.1, the current release (as of today).</p>
<p>The way to upgrade from 8.04 to 9.04 is to upgrade to 8.10 first. So I did that:</p>
<p><a href="https://help.ubuntu.com/community/IntrepidUpgrades#Network%20Upgrade%20for%20Ubuntu%20Servers%20(Recommended)">Intrepid Upgrades: Network Upgrade for Ubuntu Servers</a> worked really well. I had to do a little bit of manual file merging as usual (I still don&#8217;t understand why dpkg can&#8217;t merge changes from the old file into a new file) but that was it. Easy!</p>
<p>When I rebooted the VPS, it kernel panicked: can&#8217;t mount the root filesystem. Oh crap. /dev/xvda1 is missing? Really? I told the VPS to hard reboot and it came up fine. But that&#8217;s a little scary. (I think this is something more related to my VPS hosting provider than Ubuntu, but I haven&#8217;t yet upgraded my laptop VMWare Ubuntu VPS&#8217;s yet so I&#8217;m not sure.)</p>
<p>The second stage didn&#8217;t go so well. I did the same sort of simple upgrade: the Jaunty <a href="http://www.ubuntu.com/getubuntu/upgrading#Network%20Upgrade%20for%20Ubuntu%20Servers%20%28Recommended%29">Network Upgrade for Ubuntu Servers</a> instructions are the same as the ones for Intrepid. Upgrade, edit a couple of config files, reboot. Kernel panic again, same reason, reboot. Should work, right?</p>
<p>It booted, but had no network access. I was able to log in via my VPS hosting provider&#8217;s SSH remote console feature, so I was able to see that /etc/init.d/networking was failing to start. It was the same problem that&#8217;s described in <a href="http://www.fs3.ph/article/ubuntu-904-in-an-openvz-ve">Ubuntu 9.04 in an OpenVZ VE</a>. Adding that one line to <code>/etc/init.d/networking</code> fixed the problem. Reboot, all better.</p>
<p>So if you&#8217;re doing this upgrade on a VPS, make sure you&#8217;ve added that little 1-line hack after you do the Jaunty upgrade and before you reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2009/05/30/ubuntu-jaunty-jackalope-upgrade-notes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CentOS 5.3 Minimal VPS Install Guide</title>
		<link>http://www.pervasivecode.com/blog/2009/05/30/centos-53-minimal-vps-install-guide/</link>
		<comments>http://www.pervasivecode.com/blog/2009/05/30/centos-53-minimal-vps-install-guide/#comments</comments>
		<pubDate>Sat, 30 May 2009 16:52:14 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Parallels]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=95</guid>
		<description><![CDATA[I just did this yesterday; you can pretty much just follow my CentOS 5.1 Minimal VPS Install Guide.
The differences are:

When you get to the &#8220;More Minimizing&#8221; section, yum -C grouplist will show a package called &#8220;Yum Utilities&#8221; which you probably want to leave installed.
The Deployment_Guide-en-US file is not there so you don&#8217;t need to remove [...]]]></description>
			<content:encoded><![CDATA[<p>I just did this yesterday; you can pretty much just follow my <a href="http://www.pervasivecode.com/blog/2008/03/29/centos-51-minimal-vps-install-guide/">CentOS 5.1 Minimal VPS Install Guide</a>.</p>
<p>The differences are:</p>
<ul>
<li>When you get to the &#8220;More Minimizing&#8221; section, <code>yum -C grouplist</code> will show a package called &#8220;Yum Utilities&#8221; which you probably want to leave installed.</li>
<li>The <code>Deployment_Guide-en-US</code> file is not there so you don&#8217;t need to remove it.</li>
</ul>
<p>That&#8217;s it.</p>
<p>I should also note that downloading a 3.9GB DVD ISO image in order to build a ~700MB installed OS may not be very efficient. I didn&#8217;t bother looking for a network installer but that might be the way to get this done faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2009/05/30/centos-53-minimal-vps-install-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Linux 8.04 &#8220;Hardy Heron&#8221; Upgrade Report</title>
		<link>http://www.pervasivecode.com/blog/2008/09/08/ubuntu-linux-804-hardy-heron-upgrade-report/</link>
		<comments>http://www.pervasivecode.com/blog/2008/09/08/ubuntu-linux-804-hardy-heron-upgrade-report/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 01:50:48 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=81</guid>
		<description><![CDATA[Painless! I&#8217;m actually starting to expect it to work without hitches now.
There are a couple of config file changes that need babysitting but none of them was difficult; I really do wish it would automatically do a three way merge between its old package version, the new version, and my version, and just assume &#8220;yes&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Painless! I&#8217;m actually starting to expect it to work without hitches now.</p>
<p>There are a couple of config file changes that need babysitting but none of them was difficult; I really do wish it would automatically do a three way merge between its old package version, the new version, and my version, and just assume &#8220;yes&#8221; if they merge cleanly.</p>
<p>Instructions are trivial: see <a href="https://help.ubuntu.com/community/HardyUpgrades#Network%20Upgrade%20for%20Ubuntu%20Servers%20(Recommended)">Hardy Upgrades: Network Upgrade for Ubuntu Servers (Recommended)</a>.</p>
<p>This also works fine on Xen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/09/08/ubuntu-linux-804-hardy-heron-upgrade-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silencing pointless reverse DNS warnings from OpenSSH</title>
		<link>http://www.pervasivecode.com/blog/2008/05/22/silencing-pointless-reverse-dns-warnings-from-openssh/</link>
		<comments>http://www.pervasivecode.com/blog/2008/05/22/silencing-pointless-reverse-dns-warnings-from-openssh/#comments</comments>
		<pubDate>Thu, 22 May 2008 08:51:51 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/05/22/silencing-pointless-reverse-dns-warnings-from-openssh/</guid>
		<description><![CDATA[If you&#8217;ve been using SSH for long you&#8217;ve probably seen this at least once: Address 11.22.33.44 maps to www.foobar.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
Sometimes this is helpful. Sometimes this is really annoying and incorrect. Assuming you are a moderately well informed sysadmin and know that this message [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been using SSH for long you&#8217;ve probably seen this at least once: <code>Address 11.22.33.44 maps to www.foobar.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!</code></p>
<p>Sometimes this is helpful. Sometimes this is really annoying and incorrect. Assuming you are a moderately well informed sysadmin and know that this message can safely be ignored, you might have been stumped trying to silence it. You may have tried every option in <code>man ssh_options</code> and even some of your own (<code>STFU on</code>?) I think I may be able to help.<br />
<span id="more-74"></span><br />
First, let&#8217;s make sure we understand the situation. OpenSSH is trying to protect you from an exploit. If you are connecting via SSH to www.foobar.com for the first time, you may be vulnerable to a man in the middle attack. If the forward and reverse DNS don&#8217;t match, that might be a sign that this sort of attack is being attempted.</p>
<p>If you&#8217;re sure you know what you&#8217;re doing, though, and your OpenSSH client is warning you about a situation that you already know about, then try the SSH option:
<pre>GSSAPIAuthentication no</pre>
<p>(I figured this out by using the <code>-vv</code> option to the SSH command line client. It says <code>Next authentication method: gssapi-with-mic</code> right before the error.)</p>
<p>In my case the client and server are already acquainted via mutual public key exchange (client has known_hosts for the server, and server has authorized_keys for the client) so whether or not the DNS entries look <a href="http://www.urbandictionary.com/define.php?term=hinky">hinky</a> is immaterial. I&#8217;m in the process of migrating from one hosting environment to another so I can&#8217;t &#8220;fix&#8221; the DNS situation for another couple of weeks. Meanwhile I&#8217;m getting these warnings every hour in an email to root, which is annoying, as it currently forwards to me. And since I&#8217;m not using GSSAPI, turning it off is fine also.</p>
<p>Please do make sure you know that your situation is secure before disabling warnings like this. OK now I&#8217;ve said it enough times, make the annoying warnings go away.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/05/22/silencing-pointless-reverse-dns-warnings-from-openssh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recommended mount options for ext3</title>
		<link>http://www.pervasivecode.com/blog/2008/05/15/recommended-mount-options-for-ext3/</link>
		<comments>http://www.pervasivecode.com/blog/2008/05/15/recommended-mount-options-for-ext3/#comments</comments>
		<pubDate>Fri, 16 May 2008 03:54:30 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/05/15/recommended-mount-options-for-ext3/</guid>
		<description><![CDATA[The details of the various mount options for the ext3 filesystem are fairly well documented, but as with many things in the Unix world, knowledge is far easier to come by than wisdom. That&#8217;s a pithy way of saying that I had to do some digging to find recommendations, as opposed to explanations. So here [...]]]></description>
			<content:encoded><![CDATA[<p>The details of the various mount options for the ext3 filesystem are fairly well documented, but as with many things in the Unix world, knowledge is far easier to come by than wisdom. That&#8217;s a pithy way of saying that I had to do some digging to find recommendations, as opposed to explanations. So here are my recommendations for ext3 users (which encompasses the majority of the Linux-using world, as far as I can tell).<br />
<span id="more-70"></span></p>
<h2>noatime</h2>
<p>First of all, do yourself a favor and disable <code>atime</code> updates, using the <code>noatime</code> mount option. This yields a <i>huge</i> performance boost. </p>
<p>This is done by adding <code>noatime</code> to the appropriate lines in <code>/etc/fstab</code> (do it once for each ext3 filesystem that&#8217;s listed), in the fourth column, which probably says <code>defaults</code> now.</p>
<p>To make this change to a live, running filesystem, remount the drive (adjust this so that the right disk device is specified at the end of the line:</p>
<pre>sudo mount -o noatime,nodiratime,remount,rw /dev/xvda1</pre>
<p>(My understanding is that the <code>noatime</code> implies the <code>nodiratime</code> option, but I decided to add it just in case this was not true.)</p>
<p><code>atime</code> is a relative of the well known file modification and creation timestamps, but it tracks access to file data. That means that if you read one byte from a file, <i>even if it&#8217;s cached in RAM</i>, you&#8217;re actually also triggering a write to the directory entry for that file, so that its <code>atime</code> can be updated. (If you want to slap your forehead now in disbelief, be my guest.) And if you read a ton of little files (which happens <i>rather often</i> in the unix world), that means a ton of writes to update all of their directory entries. You don&#8217;t want that, right?</p>
<p>But do you need it? Almost certainly not. It&#8217;s required by the POSIX standard, and the need for it to be present and turned on is well debated by people more knowledgeable about this in <a href="http://kerneltrap.org/node/14148">this thread</a> from the Linux kernel mailing list. The summary of their argument is that it&#8217;s the kernel&#8217;s job to remain standards compliant, and only the distributor or user has enough information to know that they don&#8217;t care about that part of the standard and can safely disable it. I can understand that point of view.</p>
<p>Well, I did the reading, and you can safely disable it, unless you&#8217;re using mutt. If you&#8217;re using mutt, or if you&#8217;re just nervous about disabling something that somebody somewhere says you might maybe need someday, then disable <code>atime</code> for every filesystem that doesn&#8217;t have your mail spool on it, and use the <code>relatime</code> mode on that drive. (<code>relatime</code> is a clever hack that simulates <code>atime</code> behavior while skipping the disk write in certain cases.)</p>
<h2>Journaling mode</h2>
<p>Ext3 is a <a href="http://en.wikipedia.org/wiki/Journaling_file_system">journaling filesystem</a>, which is generally a good thing. There are <a href="http://www.gentoo.org/doc/en/articles/l-afig-p8.xml#doc_chap4">three modes of operation</a> for ext3&#8217;s journaling functionality, but which to use?</p>
<p>&#8220;It depends&#8221; is not very satisfying, so an easy rule of thumb would be to use <code>data=journal</code> if you really, really want to ensure the durability of your data, and <code>data=ordered</code> if you can tolerate a teeny tiny chance of data corruption.</p>
<p>I measured all three journaling modes by running <code>time sudo rsnapshot hourly</code> on a VPS that backed up VPSs on the same physical server to a dedicated backup disk. In other words, the source was on the same physical server as the destination but they were on different disks.</p>
<p><code>rsnapshot</code> uses hard links to share file data across backup sets, so backing up an unchanged directory twice takes a hardly any additional space compared to backing it up once. But it does need to do a bunch of disk reads and writes to make all the linked directory entries when it does this, so there is a fair amount of I/O involved: more than what rsync would need to just update a local directory to match the remote directory, but far less than what would be needed to make a separate copy of every file for each backup.</p>
<p>In abstract terms, the I/O for this backup process involves a lot of small reads and writes, and a very small number of medium or large writes for changed files. All of these occur as fast as the disk can service them, and the disk is quiet aside from this activity.</p>
<p>Here&#8217;s what I measured (in three test runs per journal type):</p>
<style type="text/css">
table tr td {padding: 6px;}
table tr th {padding: 6px; border: 1px #CCC solid; text-weight: bold;}
</style>
<table>
<tr>
<th>Journal Type</th>
<th>Real Time</th>
</tr>
<tr>
<td>data=journal</td>
<td>2m05s, 2m57s, 2m51s</td>
</tr>
<tr>
<td>data=writeback</td>
<td>2m03s, 1m18s, 1m22s</td>
</tr>
<tr>
<td>data=ordered</td>
<td>2m12s, 1m30s, 1m20s</td>
</tr>
</table>
<p>For this application, <code>data=journal</code> takes twice as long as the others, while <code>data=ordered</code> runs just as fast as <code>data=writeback</code> while providing some additional protection.</p>
<p>So <code>data=writeback</code> is useless in my case, and the fact that <code>data=ordered</code> is the default makes sense. You get almost the same level of data protection as with <code>data=journal</code>, but with the performance of <code>data=writeback</code>. Different I/O patterns will give different results, but I suspect that the pattern I tested with is the most common in real server usage. (Note that in ext3&#8217;s v1 journal format, <code>data=journal</code> was the only journal behavior.)</p>
<p>My inclination is to stick with the default setting, even using <code>data=ordered</code> on database servers, since the database is doing its own higher-level journaling in the form of a transaction log. I&#8217;m basing this recommendation on this detail from the Gentoo article:</p>
<blockquote><p>
<em>When appending data to files, data=ordered mode provides all of the integrity guarantees offered by ext3&#8217;s full data journaling mode. However, if part of a file is being overwritten and the system crashes, it&#8217;s possible that the region being written will contain a combination of original blocks interspersed with updated blocks.</em>
</p></blockquote>
<p>Since a database transaction log is generally appended to rather than overwritten, my understanding is that it will protect against the above scenario in which <code>data=ordered</code> can cause a mix of old and new data. The database&#8217;s data files may have a mix of old and new data, but the transaction log would not show that the transaction have been completed yet, so it would be re-run during recovery and the remaining old data would be removed. I think.</p>
<p>The usage pattern where data that you really care about is overwritten regularly (as opposed to logs, which simply append) is rare in my experience, except in the case of database servers which are covered by their own logs as I just mentioned. So I don&#8217;t know of a particular application type that demands the full data journaling mode.</p>
<p>Anyway, I recommend against <code>data=writeback</code> altogether, unless you don&#8217;t mind some data corruption if there&#8217;s a power failure. The speed gain I measured isn&#8217;t worth the risk, in my opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/05/15/recommended-mount-options-for-ext3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Retroactively Minimizing Installed Packages on CentOS 5.1</title>
		<link>http://www.pervasivecode.com/blog/2008/04/14/retroactively-minimizing-installed-packages-on-centos-51/</link>
		<comments>http://www.pervasivecode.com/blog/2008/04/14/retroactively-minimizing-installed-packages-on-centos-51/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 01:16:44 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/04/14/retroactively-minimizing-installed-packages-on-centos-51/</guid>
		<description><![CDATA[In my CentOS 5.1 Minimal VPS Install Guide I describe how to install a very lean set of OS packages when starting from scratch. But what if the VPS is preinstalled for you by a hosting provider? There will be things preinstalled that you don&#8217;t need, which will slow down backups and updates, and waste [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="/blog/2008/03/29/centos-51-minimal-vps-install-guide/">CentOS 5.1 Minimal VPS Install Guide</a> I describe how to install a very lean set of OS packages when starting from scratch. But what if the VPS is preinstalled for you by a hosting provider? There will be things preinstalled that you don&#8217;t need, which will slow down backups and updates, and waste the relatively tiny amount of disk space that VPS plans offer. So here are some instructions to help you identify and remove packages that you don&#8217;t need, when they&#8217;ve already been installed.<br />
<span id="more-68"></span><br />
The first thing you need is a list of minimal packages that your server must have in order to function. This is somewhat subjective, so you may wish to customize it, but <a href="/code/CentOS_5.1_minimal_yum_package_names.txt">here is a roughly minimal list of yum package names for CentOS 5.1</a>. Save that on your CentOS machine as minimal_package_names.txt.</p>
<p>Next, you need a way to compare this list to the list of what you have installed. Here&#8217;s a command line that I used:</p>
<p><code>
<pre>yum list installed | awk 'split($1,a,".") { if (NR>2){ print a[1] } }' \\
> installed_package_names.txt ; diff installed_package_names.txt \\
minimal_package_names.txt  | grep '<' | colrm 1 2
</pre>
<p></code></p>
<p>(The awk command is there to strip out the version number and architecture from the package name.)</p>
<p>Now you can run that command and see a list of package names that are not in your minimal_package_names.txt list. You can switch that grep command so it looks for '>' instead of '<', and see things that you consider minimal which are not currently installed.</p>
<p>Then it's just a matter of "yum install foo" and "yum remove foo". I encourage you to use "yum info foo" to make removal decisions one by one, since someone at the ISP probably took the time to research them and thought you might find them useful. You should probably also remove packages in small groups or one by one, because you might be surprised at the dependencies you find. I was surprised to find that uninstalling postgresql-libs would cause httpd (Apache) to be removed as well.</p>
<p>But if you want to automate it, just tack <code>| xargs yum remove</code> on the end of that command, and it will automatically remove them all at once.</p>
<p>Using this as a starting point, you can change your "minimal" packages list to fit your preferences, or even as a quick and dirty alternative to using Kickstart.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/04/14/retroactively-minimizing-installed-packages-on-centos-51/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sphinx Search init script for Centos 5.1</title>
		<link>http://www.pervasivecode.com/blog/2008/04/14/sphinx-search-init-script-for-centos-51/</link>
		<comments>http://www.pervasivecode.com/blog/2008/04/14/sphinx-search-init-script-for-centos-51/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 06:18:11 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/2008/04/14/sphinx-search-init-script-for-centos-51/</guid>
		<description><![CDATA[Sphinx search is pretty new, and as a result I was unable to find a nice convenient package for it for CentOS 5.1. This is problematic since there is no init script included with the source tarball, and the issue of updating the index is the sysadmin and developer&#8217;s problem, and cannot be configured to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sphinxsearch.com/">Sphinx search</a> is pretty new, and as a result I was unable to find a nice convenient package for it for CentOS 5.1. This is problematic since there is no init script included with the source tarball, and the issue of updating the index is the sysadmin and developer&#8217;s problem, and cannot be configured to simply update the index when the data changes.<br />
<span id="more-65"></span><br />
The second problem (updates) is one I punted on; for now I have a cron job rebuilding the entire index every 5 minutes, which will probably be replaced with something smarter and lower-latency at a later time.</p>
<p>The first problem (no init script) is easy to solve, but apparently nobody has done so for CentOS 5.1 and published it. So, here is <a href="/code/centos_sphinx_init_script.txt">my CentOS 5.1 init script for the Sphinx Search server</a>. It is known to work with version 0.9.8-rc2.</p>
<p>BTW, the alternative solution to the problem of a daemon not having a System V init script is to just put some extra junk in <code>/etc/rc.local</code>. That is the quick and dirty solution, and is undesirable for several reasons:</p>
<ol>
<li>You can&#8217;t easily stop or restart the service, because it&#8217;s not a service as far as the OS knows; it&#8217;s just some junk in a script that got run a while ago.</li>
<li>You can&#8217;t use <a href="http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-services-chkconfig.html">chkconfig</a> or its GUI cousin with the creative name, <a href="http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-services-serviceconf.html">The Services Configuration Tool</a>, to control it and tie it to specific runlevels.</li>
</ol>
<p>(System V runlevels and init scripts are useful, even if you don&#8217;t need all of the runlevel functionality. The stop/start/restart PID stuff is useful by itself.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2008/04/14/sphinx-search-init-script-for-centos-51/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
