<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Racker Hacker &#187; emergency</title>
	<atom:link href="http://rackerhacker.com/tag/emergency/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:07:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Strategies for storing backups</title>
		<link>http://rackerhacker.com/2011/01/09/strategies-for-storing-backups/</link>
		<comments>http://rackerhacker.com/2011/01/09/strategies-for-storing-backups/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 01:20:44 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[general advice]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2123</guid>
		<description><![CDATA[Although it's not a glamorous subject for system administrators, backups are necessary for any production environment. Those who run their systems without backups generally learn from their errors in a very painful way. However, the way you store your backups may sometimes prove to be just as vital as the methods you use to backup [...]<p><a href="http://rackerhacker.com/2011/01/09/strategies-for-storing-backups/">Strategies for storing backups</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Although it's not a glamorous subject for system administrators, backups are necessary for any production environment.  Those who run their systems without backups generally learn from their errors in a very painful way.  However, the way you store your backups may sometimes prove to be just as vital as the methods you use to backup your data.</p>
<p>For my environments, I follow a strategy like this: I have some backups immediately accessible, others that are accessible very quickly (but not instantly), and others that are offsite and may take a bit more time to access.</p>
<p><strong>Immediately accessible backups</strong><br />
One of the easiest way to have an immediately accessible backup is to have multiple machines online running the same versions of code or databases in a high availability group.  If you have a node which fails, the remaining nodes should be able to handle the requests immediately.  You may not consider this to be a backup under the traditional definition of what a backup should be, but it's functionally similar.</p>
<p><strong>Backups that are accessible quickly</strong><br />
This second level of backups should be stored very close to your environment or within the environment itself.  If you have multiple database and web server nodes, you could consider storing your web backups on the database servers and vice versa.  For those who run very sensitive applications, this may violate the provisions of different certifications and regulations.  A server dedicated to holding backups may be a viable alternative for additional security.</p>
<p><strong>Offsite backup storage</strong><br />
These are the backups that need to be geographically distant from your main environment.  Also, you should always consider storing these backups on more than one medium with more than one company.</p>
<p>For example, if your hosting providers offers a storage service, it's fine to store one set of your backups there, but consider storing them with a competitor as well.  If you store your backups with your hosting provider in multiple places, you could be caught be a provider issue and lose access to your backups entirely.  Hosting with multiple providers will allow you to access at least one copy of your backups even if there are billing or technical issues with a particular provider.</p>
<p>Another thing to keep in mind with offsite backup storage is how long it will take to transfer the backups to your hosting environment in case of an emergency.  If your hosting environment is in Texas, but your backups are stored in Australia, you're going to have a longer wait when you transfer your data back.</p>
<p><strong>A specific example</strong><br />
My environments are all in Dallas, Texas and I have a highly available environment with multiple instances.  My second layer of backups are stored within the environment as well as in Rackspace's Cloud Files in Dallas.  My third layer of backups are stored with Amazon S3 via Jungle Disk and at my home on a RAID array.</p>
<p>While I hope you never need to access your backups under duress, these tips should help to reduce your stress if you need to restore data in a hurry.</p>
<p><a href="http://rackerhacker.com/2011/01/09/strategies-for-storing-backups/">Strategies for storing backups</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/01/09/strategies-for-storing-backups/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mounting a raw partition file made with dd or dd_rescue in Linux</title>
		<link>http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/</link>
		<comments>http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 01:07:24 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2069</guid>
		<description><![CDATA[This situation might not affect everyone, but it struck me today and left me scratching my head. Consider a situation where you need to clone one drive to another with dd or when a hard drive is failing badly and you use dd_rescue to salvage whatever data you can. Let's say you cloned data from [...]<p><a href="http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/">Mounting a raw partition file made with dd or dd_rescue in Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>This situation might not affect everyone, but it struck me today and left me scratching my head.  Consider a situation where you need to clone one drive to another with <a href="http://en.wikipedia.org/wiki/Dd_(Unix)">dd</a> or when a hard drive is failing badly and you use <a href="http://www.garloff.de/kurt/linux/ddrescue/">dd_rescue</a> to salvage whatever data you can.</p>
<p>Let's say you cloned data from a drive using something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># dd if=/dev/sda of=/mnt/nfs/backup/harddrive.img</pre></div></div>

<p>Once that's finished, you should end up with your partition table as well as the grub data from the MBR in your image file.  If you run <code>file</code> against the image file you made, you should see something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># file harddrive.img
harddrive.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, stage2 
address 0x2000, stage2 segment 0x200, GRUB version 0.97; partition 1: ID=0x83, 
active, starthead 1, startsector 63, 33640047 sectors, code offset 0x48</pre></div></div>

<p>What if you want to pull some files from this image without writing it out to another disk?  Mounting it like a loop file isn't going to work:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mount harddrive /mnt/temp
mount: you must specify the filesystem type</pre></div></div>

<p>The key is to mount the file <a href="http://www.linuxquestions.org/questions/linux-general-1/trouble-mounting-dd-image-file-644362/#post3660310">with an offset specified</a>.  In the output from <code>file</code>, there is a particular portion of the output that will help you:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">... startsector 63 ...</pre></div></div>

<p>This means that the filesystem itself starts on sector 63.  You can also view this with <code>fdisk -l</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># fdisk -l harddrive.img
                    Device Boot      Start         End      Blocks   Id  System
harddrive.img                *          63    33640109    16820023+  83  Linux</pre></div></div>

<p>Since we need to scoot 63 sectors ahead, and each sector is 512 bytes long, we need to use an offset of 32,256 bytes.  Fire up the mount command and you'll be on your way:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mount -o ro,loop,offset=32256 harddrive.img /mnt/loop
# mount | grep harddrive.img
/root/harddrive.img on /mnt/loop type ext3 (ro,loop=/dev/loop1,offset=32256)</pre></div></div>

<p>If you made this image under duress (due to a failing drive or other emergency), you might have to check and repair the filesystem first.  Doing that is easy if you make a loop device:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># losetup --offset 32256 /dev/loop2 harddrive.img
# fsck /dev/loop2</pre></div></div>

<p>Once that's complete, you can save some time and mount the loop device directly:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mount /dev/loop2 /mnt/loop</pre></div></div>

<p><a href="http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/">Mounting a raw partition file made with dd or dd_rescue in Linux</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Monitor MySQL restore progress with pv</title>
		<link>http://rackerhacker.com/2010/11/24/monitor-mysql-restore-progress-with-pv/</link>
		<comments>http://rackerhacker.com/2010/11/24/monitor-mysql-restore-progress-with-pv/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 16:43:28 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1951</guid>
		<description><![CDATA[The pv command is one that I really enjoy using but it's also one that I often forget about. You can't get a much more concise definition of what pv does than this one: pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage [...]<p><a href="http://rackerhacker.com/2010/11/24/monitor-mysql-restore-progress-with-pv/">Monitor MySQL restore progress with pv</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://linux.die.net/man/1/pv">pv</a> command is one that I really enjoy using but it's also one that I often forget about.  You can't get a much more concise definition of what pv does than this one:</p>
<blockquote><p>pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.</p></blockquote>
<p>The usage certainly isn't complicated:</p>
<blockquote><p>To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error.</p></blockquote>
<p>A great application of pv is when you're restoring large amounts of data into MySQL, especially if you're restoring data under duress due to an accidentally-dropped table or database.  (Who hasn't been there before?)  The standard way of restoring data is something we're all familiar with:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mysql my_database &lt; database_backup.sql</pre></div></div>

<p>The downside of this method is that you have no idea how quickly your restore is working or when it might be done.  You could always open another terminal to monitor the tables and databases as they're created, but that can be hard to follow.</p>
<p>Toss in pv and that problem is solved:
</pre>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># pv database_backup.sql | mysql my_database
96.8MB 0:00:17 [5.51MB/s] [==&gt;                                ] 11% ETA 0:02:10</pre></div></div>

<p>When it comes to MySQL, your restore rate is going to be different based on some different factors, so the ETA might not be entirely accurate.</p>
<p><a href="http://rackerhacker.com/2010/11/24/monitor-mysql-restore-progress-with-pv/">Monitor MySQL restore progress with pv</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/11/24/monitor-mysql-restore-progress-with-pv/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</title>
		<link>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/</link>
		<comments>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:14:02 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=981</guid>
		<description><![CDATA[If you use Fedora 11 in a virtualized environment, you may have seen this error recently if you've updated to apr-1.3.8-1: [root@f11 ~]# /etc/init.d/httpd start Starting httpd: [Fri Aug 14 17:05:24 2009] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null) Syntax error on line 134 of /etc/httpd/conf/httpd.conf: Listen setup failed [FAILED] The [...]<p><a href="http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/">Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you use Fedora 11 in a virtualized environment, you may have seen this error recently if you've updated to apr-1.3.8-1:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@f11 ~]# /etc/init.d/httpd start
Starting httpd: [Fri Aug 14 17:05:24 2009] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 134 of /etc/httpd/conf/httpd.conf:
Listen setup failed
                                                           [FAILED]</pre></div></div>

<p>The issue is related to three kernel calls that are used in apr-1.3.8-1: accept4(), dup3() and epoll_create1().  Without these calls, apache is unable to start.  </p>
<p><strong><u>Update on August 17, 2009:</u> the Fedora team has <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331#c12">pushed apr-1.3.8-2 into the stable repositories</a> for Fedora 11, which eliminates the need for the temporary fix shown below.</strong></p>
<p><strong>Deprecated solution:</strong> There is a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331">bug open</a> with the Fedora team, and there is a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331#c10">temporary fix</a> available:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum --enablerepo=updates-testing update apr</pre></div></div>

<p><a href="http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/">Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Re-scan the SCSI bus in Linux after hot-swapping a drive</title>
		<link>http://rackerhacker.com/2009/04/23/re-scan-the-scsi-bus-in-linux-after-hot-swapping-a-drive/</link>
		<comments>http://rackerhacker.com/2009/04/23/re-scan-the-scsi-bus-in-linux-after-hot-swapping-a-drive/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 17:00:54 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[scsi]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=832</guid>
		<description><![CDATA[Servers with hot swappable drive bays are always handy. However, things can turn ugly if the SCSI controller doesn't like a new drive when it is inserted. You may end up with these errors in your dmesg output: kernel: sdb : READ CAPACITY failed. kernel: sdb : status=0, message=00, host=4, driver=00 kernel: sdb : sense [...]<p><a href="http://rackerhacker.com/2009/04/23/re-scan-the-scsi-bus-in-linux-after-hot-swapping-a-drive/">Re-scan the SCSI bus in Linux after hot-swapping a drive</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Servers with hot swappable drive bays are always handy.  However, things can turn ugly if the SCSI controller doesn't like a new drive when it is inserted.  You may end up with these errors in your dmesg output:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kernel: sdb : READ CAPACITY failed.
kernel: sdb : status=0, message=00, host=4, driver=00 
kernel: sdb : sense not available. 
kernel: sdb: Write Protect is off
kernel: sdb: Mode Sense: 00 00 00 00
kernel: sdb: asking for cache data failed
kernel: sdb: assuming drive cache: write through
kernel:  sdb:&amp;lt;6&gt;sd 1:0:0:0: SCSI error: return code = 0x00040000
kernel: end_request: I/O error, dev sdb, sector 0
kernel: Buffer I/O error on device sdb, logical block 0
kernel: sd 1:0:0:0: SCSI error: return code = 0x00040000
kernel: end_request: I/O error, dev sdb, sector 0
kernel: Buffer I/O error on device sdb, logical block 0
kernel: sd 1:0:0:0: SCSI error: return code = 0x00040000
kernel: end_request: I/O error, dev sdb, sector 0</pre></div></div>

<p>The errors show that the SCSI bus is having issues bringing the new drive online, and it won't be seen by the OS until the SCSI controller is pleased.  You can force the controller to re-scan the drives attached to it, and this should correct the problem:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">cd /sys/class/scsi_host/hostX
echo &quot;- - - &quot; &gt; scan</pre></div></div>

<p>Replace the <b>X</b> with the proper controller number of your SCSI controller.  If you're not sure which controller is which, try running:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># cat /sys/class/scsi_host/host0/proc_name
sata_nv</pre></div></div>

<p><em>Credit for this find goes to Tony Dolan</em></p>
<p><a href="http://rackerhacker.com/2009/04/23/re-scan-the-scsi-bus-in-linux-after-hot-swapping-a-drive/">Re-scan the SCSI bus in Linux after hot-swapping a drive</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/04/23/re-scan-the-scsi-bus-in-linux-after-hot-swapping-a-drive/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Linux: emergency reboot or shutdown with magic commands</title>
		<link>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/</link>
		<comments>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 02:07:06 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=727</guid>
		<description><![CDATA[Most linux distributions use some type of mechanism to gracefully stop daemons and unmount storage volumes during a reboot or shutdown. It's most commonly done via scripts that will wait for each daemon to shut down gracefully before proceeding to the next daemon. As we know, sometimes servers misbehave due to things put them through, [...]<p><a href="http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/">Linux: emergency reboot or shutdown with magic commands</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Most linux distributions use some type of mechanism to gracefully stop daemons and unmount storage volumes during a reboot or shutdown.  It's most commonly done via scripts that will wait for each daemon to shut down gracefully before proceeding to the next daemon.</p>
<p>As we know, sometimes servers misbehave due to things put them through, and you can quickly end up in a situation where things are going badly.  I'm talking about the type of situation where you're connected via SSH to a server that controls phone lines for five million people and it sits in a tiny building 400 miles away from the nearest human being.  We're talking bad.  If you issue a plain <code>reboot</code> command, it might not even make it that far.  Once SSH stops running, you're going to be out of luck.</p>
<p>If you find yourself in this situation (and I hope you won't!), you have some options to get your way with a misbehaving server remotely.  You can force an immediate reboot with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/kernel/sysrq 
echo b &gt; /proc/sysrq-trigger</pre></div></div>

<p><span style="color: #ff0000;"><strong>WHOA THERE!</strong></span> This is pretty much the same as pressing the reset button on the server (if equipped).  No daemons will be shut down gracefully, no filesystem sync will occur, and you may get the wrath of a fsck (or worse, a non-booting server) upon reboot.  To do things a little more carefully, read on.</p>
<p>These are called <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key">magic commands</a>, and they're pretty much synonymous with holding down Alt-SysRq and another key on older keyboards.  Dropping <code>1</code> into <code>/proc/sys/kernel/sysrq</code> tells the kernel that you want to enable SysRq access (it's usually disabled).  The second command is equivalent to pressing Alt-SysRq-b on a QWERTY keyboard.</p>
<p>There's a better way of rebooting a misbehaving server that <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key#.22Raising_Elephants.22_mnemonic_device">Wikipedia shows</a> with the mnemonic "Reboot Even If System Utterly Broken":</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">unRaw      (take control of keyboard back from X),  
 tErminate (send SIGTERM to all processes),
 kIll      (send SIGKILL to all processes), 
  Sync     (flush data to disk),
  Unmount  (remount all filesystems read-only),
reBoot.</pre></div></div>

<p>I can't vouch for this actually working, but I'm interested to try it.  <strong>UPDATE:</strong> I've been told that doing this series of commands with ReiserFS is a very bad idea.</p>
<p>If you want to shut the machine down entirely (please think about it before using this on a remote system):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/kernel/sysrq 
echo o &gt; /proc/sysrq-trigger</pre></div></div>

<p>If you want to keep SysRq enabled all the time, you can do that with an entry in your server's <code>sysctl.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kernel.sysrq = 1</pre></div></div>

<p><a href="http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/">Linux: emergency reboot or shutdown with magic commands</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Reducing inode and dentry caches to keep OOM killer at bay</title>
		<link>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/</link>
		<comments>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 00:44:20 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=635</guid>
		<description><![CDATA[When it comes to frustrating parts of the Linux kernel, OOM killer takes the cake. If it finds that applications are using too much memory on the server, it will kill process abruptly to free up memory for the system to use. I spent much of this week wrestling with a server that was in [...]<p><a href="http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/">Reducing inode and dentry caches to keep OOM killer at bay</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>When it comes to frustrating parts of the Linux kernel, <a href="http://linux-mm.org/OOM_Killer">OOM killer</a> takes the cake. If it finds that applications are using too much memory on the server, it will kill process abruptly to free up memory for the system to use.  I spent much of this week wrestling with a server that was in the clutches of OOM killer.</p>
<p>There are a few processes on the server that keep it fairly busy.  Two of the processes are vital to the server's operation - if they are stopped, lots of work is required to get them running properly again.  I found that a certain java process was being killed by OOM killer regularly, and another perl process was being killed occasionally.</p>
<p>Naturally, my disdain for java made me think that the java process was the source of the issue.  The process was configured to use a small amount of RAM, so it was ruled out.  The other perl process used even less memory, so it was ruled out as well.  When I checked the sysstat data with sar, I found that the server was only using about 2-3GB out of 4GB of physical memory at the time when OOM killer was started.  <em>At this point, I was utterly perplexed.</em></p>
<p>I polled some folks around the office and gathered some ideas.  After putting some ideas together, I found that the server was actually caching too much data in the <code>ext3_inode_cache</code> and <code>dentry_cache</code>.  These caches hold recently accessed files and directories on the server, and they're purged as the files and directories become stale.  Since the operations on the server read and write large amounts of data locally and via NFS, I knew these caches had to be gigantic.  If you want to check your own caches, you can use the <code>slabtop</code> command.  For those who like things more difficult, you can also <code>cat</code> the contents of <code>/proc/slabinfo</code> and grep for the caches that are important to you.</p>
<p>An immense amount of Googling revealed very little, but I discovered a <a href="http://www.linuxinsight.com/proc_sys_vm_drop_caches.html">dirty hack</a> to fix the issue <strong>(don't run this yet)</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/vm/drop_caches  # free pagecache
     [OR]
echo 2 &gt; /proc/sys/vm/drop_caches  # free dentries and inodes
     [OR]
echo 3 &gt; /proc/sys/vm/drop_caches  # free pagecache, dentries and inodes
sync  # forces the dump to be destructive</pre></div></div>

<p><strong><u>There are huge consequences to dumping these caches and running <code>sync</code>.</u></strong>  If you are writing data at the time you run these commands, you'll actually be dumping the data out of the filesystem cache before it reaches the disk, which could lead to very bad things.</p>
<p>While discussing the issue with a coworker, he <a href="http://www.linuxinsight.com/proc_sys_vm_vfs_cache_pressure.html">found a different method</a> for correcting the issue that was <strong>much</strong> safer.  You can echo values into <strong>/proc/sys/vm/vfs_cache_pressure</strong> to tell the kernel what priority it should take when clearing out the inode/dentry caches.  LinuxInsight explains the range of values well:</p>
<blockquote><p>At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.</p></blockquote>
<p>In short, values less than 100 won't reduce the caches very much as all.  Values over 100 will signal to the kernel that you want to clear out the caches at a higher priority.  I found that no matter what value you use, the kernel clears the caches at a slow rate.  I've been using a value of 10000 on the server I talked about earlier in the article, and it has kept the caches down to a reasonable level.</p>
<p><a href="http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/">Reducing inode and dentry caches to keep OOM killer at bay</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ext3_dx_add_entry: Directory index full!</title>
		<link>http://rackerhacker.com/2008/10/13/ext3_dx_add_entry-directory-index-full/</link>
		<comments>http://rackerhacker.com/2008/10/13/ext3_dx_add_entry-directory-index-full/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 17:00:51 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[fsck]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=510</guid>
		<description><![CDATA[I found a server last week that was having severe issues with disk I/O to the point where most operations were taking many minutes to complete. The server wasn't under much load, but a quick run of dmesg threw quite a bit of these lines out onto the screen: EXT3-fs warning (device sda5): ext3_dx_add_entry: Directory [...]<p><a href="http://rackerhacker.com/2008/10/13/ext3_dx_add_entry-directory-index-full/">ext3_dx_add_entry: Directory index full!</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I found a server last week that was having severe issues with disk I/O to the point where most operations were taking many minutes to complete.  The server wasn't  under much load, but a quick run of <code>dmesg</code> threw quite a bit of these lines out onto the screen:</p>
<p><code>EXT3-fs warning (device sda5): ext3_dx_add_entry: Directory index full!</code></p>
<p>After a thorough amount of searching, I couldn't find out what the error actually meant.  As with most errors starting with <code>EXT3-fs warning</code>, I figured that a fsck might be the best option.</p>
<p>During the fsck, several inodes were repaired and the check completed after 10-15 minutes.  I jotted down some notes about the directories that popped up on the screen during the fsck.  The server rebooted it came up without any problems.  </p>
<p>I reviewed the directories that appeared during the fsck and they were full of files.  Some of the directories contained upwards of 200,000 files.  Many of the files were moved into lost+found after the fsck, so they had to be restored from their backups.  I still don't know what caused the original issue as the hardware checked out fine.  If you run into this error, a fsck should help, but make sure that you have backups handy.</p>
<p><a href="http://rackerhacker.com/2008/10/13/ext3_dx_add_entry-directory-index-full/">ext3_dx_add_entry: Directory index full!</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/10/13/ext3_dx_add_entry-directory-index-full/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EXT3-fs error (device hda3) in start_transaction: Journal has aborted</title>
		<link>http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/</link>
		<comments>http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 18:23:40 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[filesystem]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/</guid>
		<description><![CDATA[If your system abruptly loses power, or if a RAID card is beginning to fail, you might see an ominous message like this within your logs: EXT3-fs error (device hda3) in start_transaction: Journal has aborted Basically, the system is telling you that it's detected a filesystem/journal mismatch, and it can't utilize the journal any longer. [...]<p><a href="http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/">EXT3-fs error (device hda3) in start_transaction: Journal has aborted</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If your system abruptly loses power, or if a RAID card is beginning to fail, you might see an ominous message like this within your logs:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">EXT3-fs error (device hda3) in start_transaction: Journal has aborted</pre></div></div>

<p>Basically, the system is telling you that it's detected a filesystem/journal mismatch, and it can't utilize the journal any longer.  When this situation pops up, the filesystem gets mounted read-only almost immediately.  To fix the situation, you can remount the partition as ext2 (if it isn't your active root partition), or you can commence the repair operations.</p>
<p>If you're working with an active root partition, you will need to boot into some rescue media and perform these operations there.  If this error occurs with an additional partition besides the root partition, simply unmount the broken filesystem and proceed with these operations.</p>
<p>Remove the journal from the filesystem (effectively turning it into ext2):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># tune2fs -O ^has_journal /dev/hda3</pre></div></div>

<p>Now, you will need to fsck it to correct any possible problems (throw in a -y flag to say yes to all repairs, -C for a progress bar):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># e2fsck /dev/hda3</pre></div></div>

<p>Once that's finished, make a new journal which effectively makes the partition an ext3 filesystem again:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># tune2fs -j /dev/hda3</pre></div></div>

<p>You should be able to mount the partition as an ext3 partition at this time:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mount -t ext3 /dev/hda3 /mnt/fixed</pre></div></div>

<p>Be sure to check your dmesg output for any additional errors after you're finished!</p>
<p><a href="http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/">EXT3-fs error (device hda3) in start_transaction: Journal has aborted</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Plesk authorization failed: HTTP request error [7]</title>
		<link>http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/</link>
		<comments>http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 18:05:24 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[emergency]]></category>
		<category><![CDATA[plesk]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/</guid>
		<description><![CDATA[I found myself wrestling with a server where the Plesk interface suddenly became unavailable without any user intervention. An attempt to start the service was less than fruitful: [root@server ~]# service psa start Key file: /opt/drweb/drweb32.key - Key file not found! A path to a valid license key file does not specified. Plesk authorization failed: [...]<p><a href="http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/">Plesk authorization failed: HTTP request error [7]</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I found myself wrestling with a server where the Plesk interface suddenly became unavailable without any user intervention.  An attempt to start the service was less than fruitful:</p>
<p><code>
<pre>[root@server ~]# service psa start
Key file: /opt/drweb/drweb32.key - Key file not found!
A path to a valid license key file does not specified.
Plesk authorization failed: HTTP request error [7]
Error: Plesk Software not running.
                                                           [FAILED]</pre>
<p></code></p>
<p><em>(Although I included the text from the drweb failure, I later found that it was not related to the issue.  However, since it might appear in your logs prior to the HTTP request error, I included it anyways.)</em></p>
<p>This was a perfectly working server that had no other issues besides this peculiar Plesk issue.  Another technician had upgraded the license a few weeks prior, and it was verified at the the time to be working properly.  After a bit of Google searching, I found that the solution was to completely stop Plesk and its related services and then start it all up again.</p>
<p><code>
<pre>[root@server ~]# service psa stopall
/usr/local/psa/admin/bin/httpsdctl stop: httpd stopped
Stopping Plesk:                                            [  OK  ]
Stopping named:                                            [  OK  ]
service psa startStopping MySQL:                           [  OK  ]
Stopping : Stopping Courier-IMAP server:
   Stopping imap                                           [  OK  ]
   Stopping imap-ssl                                       [  OK  ]
   Stopping pop3                                           [  OK  ]
   Stopping pop3-ssl                                       [  OK  ]

Stopping postgresql service:                               [  OK  ]
Shutting down psa-spamassassin service:                    [  OK  ]
Stopping httpd:                                            [  OK  ]

[root@server ~]# service psa start
Starting named:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]
Starting qmail:                                            [  OK  ]
Starting Courier-IMAP server:
   Starting imapd                                          [  OK  ]
   Starting imap-ssl                                       [  OK  ]
   Starting pop3                                           [  OK  ]
   Starting pop3-ssl                                       [  OK  ]

Starting postgresql service:                               [  OK  ]
Starting psa-spamassassin service:                         [  OK  ]
Processing config directory: /usr/local/psa/admin/conf/httpsd.*.include
/usr/local/psa/admin/bin/httpsdctl start: httpd started
Starting Plesk:                                            [  OK  ]
Starting up drwebd:                                        [  OK  ]</pre>
<p></code></p>
<p>I couldn't nail down anything within the Plesk log files that would explain the cause of the problem, but this solution corrected the issue instantly.</p>
<p><em>This issue occurred with Plesk 8.1.1 on Red Hat Enterprise Linux 4 Update 5</em></p>
<p><a href="http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/">Plesk authorization failed: HTTP request error [7]</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/11/14/plesk-authorization-failed-http-request-error-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rackspace Outage</title>
		<link>http://rackerhacker.com/2007/11/13/rackspace-outage/</link>
		<comments>http://rackerhacker.com/2007/11/13/rackspace-outage/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 00:34:11 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/11/13/rackspace-outage/</guid>
		<description><![CDATA[I've received a lot of IM's and e-mails from friends and readers of this blog about the Rackspace outages on November 11th and 12th. I work for a company that believes in full disclosure, so if you want the facts, they're already available to the public: Rackspace Information Center TechCrunch - Quick, Plug The Internet [...]<p><a href="http://rackerhacker.com/2007/11/13/rackspace-outage/">Rackspace Outage</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I've received a lot of IM's and e-mails from friends and readers of this blog about the Rackspace outages on November 11th and 12th.  I work for a company that believes in full disclosure, so if you want the facts, they're already available to the public:</p>
<p><a href="http://www.rackspace.com/information/announcements/datacenter.php">Rackspace Information Center</a><br />
<a href="http://www.techcrunch.com/2007/11/12/quick-plug-the-internet-back-in-major-rackspace-outage/">TechCrunch - Quick, Plug The Internet Back In: Major Rackspace Outage</a><br />
<a href="http://laughingsquid.wordpress.com/2007/11/12/massive-power-outage-at-rackspace-dallas-data-center/">Laughing Squid - Massive Power Outage At Rackspace’s Dallas Data Center</a><br />
<a href="http://37signals.blogs.com/products/2007/11/downtime-explan.html">37Signals - Downtime Explanation</a><br />
<a href="http://valleywag.com/tech/breakdowns/truck-driver-in-texas-kills-all-the-websites-you-really-use-321881.php">ValleyWag - Truck driver in Texas kills all the websites you really use</a></p>
<p>I don't know of any additional information besides what is contained within these articles and blog posts.  However, I can tell you that I've never worked for a company before that pulled together in such large numbers to get on the phones and respond to tickets long after shifts should have been over.  Obviously, it was a horrible "perfect storm" type of situation, and no one would wish for it to happen to anyone.</p>
<p>Over the last five years, I've had dedicated servers and VPS accounts with seven companies.  Out of those seven, five have had major outages.  After those outages, I can honestly say I received a timely and courteous response from one of the companies in that list.  In one situation with a certain Texas hosting company, I had no network connectivity for almost 72 hours with no response to phone calls or trouble tickets.</p>
<p>After it's all said and done (and it's not done yet), I find myself to be very proud of the company for which I work.  Server parts will eventually fail, as will networks, generators and power grids - it's inevitable.  The important part is that the will of those who are providing the support never fails.</p>
<p>Our will is strong, and it continues to stay that way.</p>
<p><a href="http://rackerhacker.com/2007/11/13/rackspace-outage/">Rackspace Outage</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/11/13/rackspace-outage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enforcing mode requested but no policy loaded. Halting now.</title>
		<link>http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/</link>
		<comments>http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 18:17:22 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel panics]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/</guid>
		<description><![CDATA[Here's a pretty weird kernel panic that I came across the other day: Enforcing mode requested but no policy loaded. Halting now. Kernel panic - not syncing: Attempted to kill init! This usually means that you've set SELINUX in enforcing mode within /etc/sysconfig/selinux or /etc/selinux/selinux.conf but you don't have the appropriate SELINUX packages installed. To [...]<p><a href="http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/">Enforcing mode requested but no policy loaded. Halting now.</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Here's a pretty weird kernel panic that I came across the other day:</p>
<p><code>Enforcing mode requested but no policy loaded. Halting now.<br />
Kernel panic - not syncing: Attempted to kill init!</code></p>
<p>This usually means that you've set SELINUX in enforcing mode within /etc/sysconfig/selinux or /etc/selinux/selinux.conf but you don't  have the appropriate SELINUX packages installed.  To fix the issue, boot the server into the Red Hat rescue environment and disable SELINUX until you can install the proper packages that contain the SELINUX targeted configuration.</p>
<p><em>This kernel panic appeared on a Red Hat Enterprise Linux 4 Update 5 server.</em></p>
<p><a href="http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/">Enforcing mode requested but no policy loaded. Halting now.</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/10/17/enforcing-mode-requested-but-no-policy-loaded-halting-now/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DB function failed with error number 1033</title>
		<link>http://rackerhacker.com/2007/08/25/182/</link>
		<comments>http://rackerhacker.com/2007/08/25/182/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 23:18:37 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/08/25/182/</guid>
		<description><![CDATA[One of these errors might appear on your website without warning: Warning: DB function failed with error number 1033 Incorrect information in file: './database_name/table_name.frm' SQL=SELECT col1, col2 FROM table_name WHERE col3 = 'some_value' ORDER BY col1 ASC MySQL is telling you that the table structure it has within data files doesn't match the structure in [...]<p><a href="http://rackerhacker.com/2007/08/25/182/">DB function failed with error number 1033</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of these errors might appear on your website without warning:</p>
<p><code>Warning:  DB function failed with error number 1033<br />
Incorrect information in file: './database_name/table_name.frm' SQL=SELECT col1, col2 FROM table_name WHERE col3 = 'some_value' ORDER BY col1 ASC</code></p>
<p>MySQL is telling you that the table structure it has within data files doesn't match the structure in the <code>.frm</code> file that's on the disk.  There's only a few scenarios where this can happen:</p>
<p><strong>Different version of the .frm files</strong><br />
If the .frm files from an older or later version of the table are placed in MySQL's data directory, MySQL will become confused and it won't be able to determine the proper database structure.</p>
<p><strong>Pending table alteration</strong><br />
A pending database operation that ran an <code>ALTER TABLE</code> may not have written changes to the disk.  MySQL may have stopped running abruptly or the entire server may have crashed.  The normal operation for MySQL is to make changes in memory first and then perform disk operations.</p>
<p><strong>Complete wierdness</strong><br />
I cannot explain it, and I can't figure out the logic that would allow it to happen, but some web application vulnerabilities can cause this problem.  I've seen it happen with Joomla! sites running on fairly secure servers, and there was no Apache privilege escalation used to modify the .frm files directly.</p>
<p>How is it fixed?  The only way to repair it is to import the table again from a mysqldump backup, find the correct .frm file and restore it on the server, or run an <code>ALTER TABLE</code> to bring the table back to its original state.</p>
<p><a href="http://rackerhacker.com/2007/08/25/182/">DB function failed with error number 1033</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/08/25/182/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache: No space left on device: Couldn&#039;t create accept lock</title>
		<link>http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/</link>
		<comments>http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 21:55:30 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[quotas]]></category>
		<category><![CDATA[semaphore]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/</guid>
		<description><![CDATA[This error completely stumped me a couple of weeks ago. Apparently someone was adjusting the Apache configuration, then they checked their syntax and attempted to restart Apache. It went down without a problem, but it refused to start properly, and didn't bind to any ports. Within the Apache error logs, this message appeared over and [...]<p><a href="http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/">Apache: No space left on device: Couldn't create accept lock</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>This error completely stumped me a couple of weeks ago.  Apparently someone was adjusting the Apache configuration, then they checked their syntax and attempted to restart Apache.  It went down without a problem, but it refused to start properly, and didn't bind to any ports.</p>
<p>Within the Apache error logs, this message appeared over and over:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[emerg] (28)No space left on device: Couldn't create accept lock</pre></div></div>

<p>Apache is basically saying "I want to start, but I need to write some things down before I can start, and I have nowhere to write them!"  If this happens to you, check these items in order:</p>
<p><strong>1. Check your disk space</strong><br />
This comes first because it's the easiest to check, and sometimes the quickest to fix.  If you're out of disk space, then you need to fix that problem. <img src='http://rackerhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>2. Review filesystem quotas</strong><br />
If your filesystem uses quotas, you might be reaching a quota limit rather than a disk space limit.  Use <code>repquota /</code> to review your quotas on the root partition.  If you're at the limit, raise your quota or clear up some disk space.  Apache logs are usually the culprit in these situations.</p>
<p><strong>3. Clear out your active semaphores</strong><br />
Semaphores?  What the heck is a semaphore?  Well, it's actually an <a href="http://en.wikipedia.org/wiki/Semaphore">apparatus for conveying information by means of visual signals</a>.  But, when it comes to programming, <a href="http://en.wikipedia.org/wiki/Semaphore_%28programming%29">semaphores are used for communicating between the active processes of a certain application</a>.  In the case of Apache, they're used to communicate between the parent and child processes.  If Apache can't write these things down, then it can't communicate properly with all of the processes it starts.</p>
<p>I'd assume if you're reading this article, Apache has stopped running.  Run this command as root:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># ipcs -s</pre></div></div>

<p>If you see a list of semaphores, Apache has not cleaned up after itself, and some semaphores are stuck.  Clear them out with this command:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># for i in `ipcs -s | awk '/httpd/ {print $2}'`; do (ipcrm -s $i); done</pre></div></div>

<p>Now, in almost all cases, Apache should start properly.  If it doesn't, you may just be completely out of available semaphores.  You may want to increase your available semaphores, and you'll need to tickle your kernel to do so.  Add this to /etc/sysctl.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024</pre></div></div>

<p>And then run <code>sysctl -p</code> to pick up the new changes.</p>
<p>Further reading:<br />
<a href="http://en.wikipedia.org/wiki/Semaphore_%28programming%29">Wikipedia: Semaphore (Programming)</a><br />
<a href="http://www.webpipe.net/howto/Apache_accept_lock_fix">Apache accept lock fix</a></p>
<p><a href="http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/">Apache: No space left on device: Couldn't create accept lock</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>MySQL couldn&#039;t find log file</title>
		<link>http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/</link>
		<comments>http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 00:24:28 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/</guid>
		<description><![CDATA[This error will pop up when binary logging is enabled, and someone thought it was a good idea to remove binary logs from the filesystem: /usr/sbin/mysqld: File './mysql_bin.000025' not found (Errcode: 2) [ERROR] Failed to open log (file './9531_mysql_bin.000025', errno 2) [ERROR] Could not open log file [ERROR] Can't init tc log [ERROR] Aborting InnoDB: [...]<p><a href="http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/">MySQL couldn't find log file</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>This error will pop up when binary logging is enabled, and someone thought it was a good idea to remove binary logs from the filesystem:</p>
<p><code>/usr/sbin/mysqld: File './mysql_bin.000025' not found (Errcode: 2)<br />
[ERROR] Failed to open log (file './9531_mysql_bin.000025', errno 2)<br />
[ERROR] Could not open log file<br />
[ERROR] Can't init tc log<br />
[ERROR] Aborting</code></p>
<p><code>InnoDB: Starting shutdown...<br />
InnoDB: Shutdown completed; log sequence number 0 2423986213<br />
[Note] /usr/sbin/mysqld: Shutdown complete</code></p>
<p>Basically, MySQL is looking in the <strong>mysql-bin.index</strong> file and it cannot find the log files that are listed within the index.  This will keep MySQL from starting, but the fix is quick and easy.  You have two options:</p>
<p><strong>Edit the index file</strong><br />
You can edit the mysql-bin.index file in a text editor of your choice and remove the references to any logs which don't exist on the filesystem any longer.  Once you're done, save the index file and start MySQL.</p>
<p><strong>Take away the index file</strong><br />
Move or delete the index file and start MySQL.  This will cause MySQL to reset its binary log numbering scheme, so if this is important to you, you may want to choose the previous option.</p>
<p>So how do you prevent this from happening?  Use the <code>PURGE MASTER LOGS</code> statement and allow MySQL to delete its logs on its own terms.  If you're concerned about log files piling up, adjust the <code>expire_logs_days</code> variable in your /etc/my.cnf.</p>
<p>Further reading:<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html">12.6.1.1. PURGE MASTER LOGS Syntax</a><br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html">5.2.3 System Variables</a></p>
<p><a href="http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/">MySQL couldn't find log file</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/08/23/mysql-couldnt-find-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qmail-smtpd spawns many processes and uses 100% of CPU</title>
		<link>http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/</link>
		<comments>http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 02:47:18 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[emergency]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[plesk]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/</guid>
		<description><![CDATA[It's not abnormal for qmail act oddly at times with Plesk, and sometimes it can use 100% of the CPU. However, if you find qmail's load to be higher than usual with a small volume of mail, there may be a fix that you need. First off, check for two files in /var/qmail/control called dh512.pem [...]<p><a href="http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/">Qmail-smtpd spawns many processes and uses 100% of CPU</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>It's not abnormal for qmail act oddly at times with Plesk, and sometimes it can use 100% of the CPU.  However, if you find qmail's load to be higher than usual with a small volume of mail, there may be a fix that you need.</p>
<p>First off, check for two files in <strong>/var/qmail/control</strong> called <strong>dh512.pem</strong> and <strong>dh1024.pem</strong>.  If they are present, well, then this article won't be able to help you.  You have a different issue that is causing increased CPU load (check for swap usage and upgrade your disk's speed).</p>
<p>If the files aren't there, do the following:</p>
<p><code># cd /var/qmail/control<br />
# cp dhparam512.pem dh512.pem<br />
# cp dhparam1024.pem dh1024.pem<br />
# /etc/init.d/qmail restart<br />
# /etc/init.d/xinetd restart</code></p>
<p>At this point, your CPU load should be reduced once the currently running processes for qmail clear out.</p>
<p>So why is this fix required?  Without dh512.pem and dh1024.pem, qmail has to create certificate and key pairs when other mail servers or mail users connect to qmail via TLS.  If qmail is forced to generate them on the fly, you will get a big performance hit, and your load will be much higher than it could be.  By copying the dhparam files over, you will pre-populate the SSL key and certificate for qmail to use, and all it has to do is pick it up off the file system rather than regenerating it each time.</p>
<p>Further reading:<br />
<a href="http://forum.swsoft.com/printthread.php?threadid=40173">SWsoft Forums: Qmail-smtpd spawning many processes, using full cpu</a></p>
<p><a href="http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/">Qmail-smtpd spawns many processes and uses 100% of CPU</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/08/21/qmail-smtpd-spawns-many-processes-and-uses-100-of-cpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXT3-fs error: ext3_check_descriptors / group descriptors corrupted</title>
		<link>http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/</link>
		<comments>http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/#comments</comments>
		<pubDate>Wed, 01 Aug 2007 12:28:42 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel panics]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/</guid>
		<description><![CDATA[Operating System: Red Hat Enterprise Linux 4 Update 5 What happened: The server was abruptly powered down, disassembled, and re-assembled. Work done: Ran a fsck from the rescue environment and it eventually completed (after much corruption was found), but the server would not boot properly. End result: The damage to the filesystem could not be [...]<p><a href="http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/">EXT3-fs error: ext3_check_descriptors / group descriptors corrupted</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href='http://cdn.cloudfiles.mosso.com/c8031/kernelpanic-badfs.png' title='kernelpanic-badfs.png'><img src='http://cdn.cloudfiles.mosso.com/c8031/kernelpanic-badfs.thumbnail.png' alt='kernelpanic-badfs.png' /></a></p>
<p><b>Operating System:</b><br />
Red Hat Enterprise Linux 4 Update 5</p>
<p><b>What happened:</b><br />
The server was abruptly powered down, disassembled, and re-assembled.</p>
<p><b>Work done:</b><br />
Ran a fsck from the rescue environment and it eventually completed (after much corruption was found), but the server would not boot properly.</p>
<p><b>End result:</b><br />
The damage to the filesystem could not be adequately repaired as the errors were very extensive.  The RAID array had to be rebuilt and a new OS was installed.</p>
<p><a href="http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/">EXT3-fs error: ext3_check_descriptors / group descriptors corrupted</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/08/01/ext3-fs-error-ext3_check_descriptors-group-descriptors-corrupted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repair auto_increment in MySQL</title>
		<link>http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/</link>
		<comments>http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/#comments</comments>
		<pubDate>Sun, 01 Jul 2007 16:34:03 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/</guid>
		<description><![CDATA[Table corruption in MySQL can often wreak havoc on the auto_increment fields. I'm still unsure why it happens, but if you find a table tries to count from 0 after a table corruption, just find the highest key in the column and add 1 to it (in this example, I'll say the highest key is [...]<p><a href="http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/">Repair auto_increment in MySQL</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Table corruption in MySQL can often wreak havoc on the auto_increment fields.  I'm still unsure why it happens, but if you find a table tries to count from 0 after a table corruption, just find the highest key in the column and add 1 to it (in this example, I'll say the highest key is 9500).</p>
<p>Just run this one SQL statement on the table:</p>
<p><code>ALTER TABLE brokentablename AUTO_INCREMENT=9501;</code></p>
<p>If you run a quick insert and then run <code>SELECT last_insert_id()</code>, the correct key number should be returned (9501 in this case).</p>
<p><a href="http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/">Repair auto_increment in MySQL</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/07/01/repair-auto_increment-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corrupt /dev/null</title>
		<link>http://rackerhacker.com/2007/06/18/corrupt-devnull/</link>
		<comments>http://rackerhacker.com/2007/06/18/corrupt-devnull/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 02:49:56 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/06/18/corrupt-devnull/</guid>
		<description><![CDATA[If you find that /dev/null is no longer a block device, and it causes issues during init on Red Hat boxes, you will need to follow these steps to return things to normal: Reboot the server When grub appears, edit your kernel line to include init=/bin/bash at the end Allow the server to boot into [...]<p><a href="http://rackerhacker.com/2007/06/18/corrupt-devnull/">Corrupt /dev/null</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you find that /dev/null is no longer a block device, and it causes issues during init on Red Hat boxes, you will need to follow these steps to return things to normal:</p>
<ul>
<li>Reboot the server</li>
<li>When grub appears, edit your kernel line to include <code>init=/bin/bash</code> at the end</li>
<li>Allow the server to boot into the emergency shell</li>
<li>Run the following three commands</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># rm -rf /dev/null
# mknod /dev/null c 1 3
# chmod 666 /dev/null</pre></div></div>

<p>You should be back to normal.  Make sure that the root users on your server don't use <b>cp</b> or <b>mv</b> with /dev/null as this will cause some pretty ugly issues.</p>
<p><a href="http://rackerhacker.com/2007/06/18/corrupt-devnull/">Corrupt /dev/null</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/06/18/corrupt-devnull/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rebuild RPM file permissions and ownerships</title>
		<link>http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/</link>
		<comments>http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 22:36:47 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/</guid>
		<description><![CDATA[If you find that someone has done a recursive chmod or chown on a server, don't fret. You can set almost everything back to its original permissions and ownership by doing the following: rpm -qa &#124; xargs rpm --setperms --setugids Depending on how many packages are installed as well as the speed of your disk [...]<p><a href="http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/">Rebuild RPM file permissions and ownerships</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you find that someone has done a recursive chmod or chown on a server, don't fret.  You can set almost everything back to its original permissions and ownership by doing the following:</p>
<p><code>rpm -qa | xargs rpm --setperms --setugids</code></p>
<p>Depending on how many packages are installed as well as the speed of your disk I/O, this may take a while to complete.</p>
<p><a href="http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/">Rebuild RPM file permissions and ownerships</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/06/14/rebuild-rpm-file-permissions-and-ownerships/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>rpmdb: Lock table is out of available locker entries</title>
		<link>http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/</link>
		<comments>http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/#comments</comments>
		<pubDate>Sun, 27 May 2007 16:38:32 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[bdb]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[up2date]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/</guid>
		<description><![CDATA[If up2date throws some horrible Python errors and rpm says "rpmdb: Lock table is out of available locker entries", you can restore your system to normality with the following: The errors: rpmdb: Lock table is out of available locker entries error: db4 error(22) from db-&#62;close: Invalid argument error: cannot open Packages index using db3 - [...]<p><a href="http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/">rpmdb: Lock table is out of available locker entries</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If up2date throws some horrible Python errors and rpm says "rpmdb: Lock table is out of available locker entries", you can restore your system to normality with the following:</p>
<p>The errors:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">rpmdb: Lock table is out of available locker entries
error: db4 error(22) from db-&gt;close: Invalid argument
error: cannot open Packages index using db3 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm</pre></div></div>

<p>Make a backup of /var/lib/rpm in case you break something:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">tar cvzf rpmdb-backup.tar.gz /var/lib/rpm</pre></div></div>

<p>Remove the Berkeley databases that rpm uses:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">rm /var/lib/rpm/__db.00*</pre></div></div>

<p>Make rpm rebuild the databases from scratch (may take a short while):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">rpm --rebuilddb</pre></div></div>

<p>Now, check rpm to make sure everything is okay:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">rpm -qa | sort</pre></div></div>

<p><b>Why does this happen?</b><br />
When rpm accesses the Berkeley database files, it makes temporary locker entries within the tables while it searches for data.  If you control-c your rpm processes often, this issue will occur much sooner because the locks are never cleared.</p>
<p><a href="http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/">rpmdb: Lock table is out of available locker entries</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2007/05/27/rpmdb-lock-table-is-out-of-available-locker-entries/feed/</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
		<item>
		<title>Fedora/RHEL/Centos Won&#039;t Init</title>
		<link>http://rackerhacker.com/2006/12/28/fedorarhelcentos-wont-init/</link>
		<comments>http://rackerhacker.com/2006/12/28/fedorarhelcentos-wont-init/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:35:13 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[emergency]]></category>

		<guid isPermaLink="false">http://fix.mhtx.net/2006/12/28/fedorarhelcentos-wont-init/</guid>
		<description><![CDATA[In the event that a Fedora/RHEL/CentOS box won't perform the init (which comes right after the initial kernel load), don't fret - it can be fixed. Make a note of the missing libraries or executables. Simply boot onto a livecd or rescuecd and chroot into your main installation. Once you're chrooted, just forcefully install any [...]<p><a href="http://rackerhacker.com/2006/12/28/fedorarhelcentos-wont-init/">Fedora/RHEL/Centos Won't Init</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>In the event that a Fedora/RHEL/CentOS box won't perform the init (which comes right after the initial kernel load), don't fret - it can be fixed.  Make a note of the missing libraries or executables.  Simply boot onto a livecd or rescuecd and chroot into your main installation.  Once you're chrooted, just forcefully install any RPM's which might contain files that are missing when the init is loaded.</p>
<p>Forcing the installation of an RPM:<br />
<blockquote>rpm -ivh --force filename.rpm</blockquote >
<p>Listing the files that an installed RPM contains:<br />
<blockquote>rpm -ql rpmname</p></blockquote>
<p>Listing the files that an RPM file contains:<br />
<blockquote>rpm -qpl filename.rpm</p></blockquote>
<p>Finding the RPM that contains a certain file/executable:<br />
<blockquote>rpm -qf /usr/bin/filename</p></blockquote>
<p>Figuring out what might be wrong with files already installed from an RPM:<br />
<blockquote>rpm -V rpmname</p></blockquote>
<p><a href="http://rackerhacker.com/2006/12/28/fedorarhelcentos-wont-init/">Fedora/RHEL/Centos Won't Init</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2006/12/28/fedorarhelcentos-wont-init/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

