<?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>Eric Mason &#187; sysadmin</title>
	<atom:link href="http://ericmason.net/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericmason.net</link>
	<description>From Fort Lauderdale, Ruby, Linux, Photography, and Random Things</description>
	<lastBuildDate>Tue, 15 Nov 2011 20:22:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Asterisk: Automatically Update externip When Your IP Address Changes</title>
		<link>http://ericmason.net/2011/11/asterisk-automatically-update-externip-when-your-ip-address-changes/</link>
		<comments>http://ericmason.net/2011/11/asterisk-automatically-update-externip-when-your-ip-address-changes/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 15:42:35 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=189</guid>
		<description><![CDATA[I got tired of updating Asterisk&#8217;s externip setting every time my IP address changed, so I wrote this quick script, saved as /usr/local/bin/asterisk_update_externip: #!/bin/bash ip_url="http://automation.whatismyip.com/n09230945.asp" oldip=`grep externip /etc/asterisk/sip.conf &#124;sed 's/;.*//' &#124;grep -v ^$ &#124;sed s/.*=\ *//` ip=`curl -s "$ip_url" &#124;head &#8230; <a href="http://ericmason.net/2011/11/asterisk-automatically-update-externip-when-your-ip-address-changes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I got tired of updating Asterisk&#8217;s externip setting every time my IP address changed, so I wrote this quick script, saved as /usr/local/bin/asterisk_update_externip:</p>
<pre>#!/bin/bash

ip_url="http://automation.whatismyip.com/n09230945.asp"

oldip=`grep externip /etc/asterisk/sip.conf |sed 's/;.*//' |grep -v ^$ |sed s/.*=\ *//`
ip=`curl -s "$ip_url" |head -n 1`

if [ "$oldip" != "$ip" ]
then
        #echo "Updating IP"
        sed -i "s/externip = $oldip/externip = $ip/" /etc/asterisk/sip.conf
        asterisk -r -x "core reload"

fi</pre>
<p>I put it in /etc/cron.d/asterisk-externip as follows:</p>
<pre># Update Asterisk's SIP External IP
3,8,13,18,23,28,33,38,43,48,53,58 * * * * root asterisk_update_externip</pre>
<p>Enjoy!</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2011/11/asterisk-automatically-update-externip-when-your-ip-address-changes/&via=ericmason&text=Asterisk: Automatically Update externip When Your IP Address Changes&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2011/11/asterisk-automatically-update-externip-when-your-ip-address-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios Plugin to Check Memory</title>
		<link>http://ericmason.net/2011/01/nagios-plugin-to-check-memory/</link>
		<comments>http://ericmason.net/2011/01/nagios-plugin-to-check-memory/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 22:41:44 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=169</guid>
		<description><![CDATA[After a search for a check_memory plugin for Nagios turned up only a Korn shell script, I quickly wrote the following in Ruby for Linux, which I hereby release into the public domain.   Why?  All my servers have Ruby, &#8230; <a href="http://ericmason.net/2011/01/nagios-plugin-to-check-memory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a search for a check_memory plugin for Nagios turned up only a Korn shell script, I quickly wrote the following in Ruby for Linux, which I hereby release into the public domain.   Why?  All my servers have Ruby, but not Korn shell.</p>
<p><span id="more-169"></span></p>
<pre class="syntax ruby">#!/usr/bin/env ruby

require 'optparse'

options = {}
optparse = OptionParser.new do |opts|
  opts.banner = &quot;Usage: #{$0} [OPTIONS]&quot;

  opts.on('-w', '--warn PCT', 'Warn if memory usage goes over PCT') do |val|
    options[:warn_pct] = val.to_i
  end

  opts.on('-c', '--crit PCT', 'Critical if memory usage goes over PCT') do |val|
    options[:crit_pct] = val.to_i
  end

  opts.on('-h', '--help', 'Display this screen') do
    puts opts
    exit
  end
end
optparse.parse!

unless options[:crit_pct] &amp;amp;&amp;amp; options[:warn_pct]
  puts optparse.help
  exit
end

# Get the stats from /proc
mem = File.readlines(&quot;/proc/meminfo&quot;).inject({}) {|m,x| k,v = x.split(/:?\s+/); m[k] = v.to_i; m}
free = mem['MemFree'] + mem['Buffers'] + mem['Cached']
total = mem['MemTotal']
used = total - free
pct_used = used * 100 / total

if pct_used &amp;gt; options[:crit_pct]
  puts &quot;MEMORY CRTIICAL - #{pct_used}% used&quot;
  exit 2
elsif pct_used &amp;gt; options[:warn_pct]
  puts &quot;MEMORY WARNING -  #{pct_used}% used&quot;
  exit 1
else
  puts &quot;MEMORY OK - #{pct_used}% used&quot;
end</pre>
<p>This goes in /usr/lib/nagios/plugins/check_memory .  You can add it to nrpe.cfg like so:</p>
<pre class="syntax bash">command[check_memory]=/usr/lib/nagios/plugins/check_memory  -w 75 -c 85</pre>
<p>Update: Found a shell script <a href="http://www.matejunkie.com/memory-check-plugin-for-nagios/">here</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2011/01/nagios-plugin-to-check-memory/&via=ericmason&text=Nagios Plugin to Check Memory&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2011/01/nagios-plugin-to-check-memory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PuTTY SSH / Windows Clipboard Integration</title>
		<link>http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/</link>
		<comments>http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 22:36:49 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=142</guid>
		<description><![CDATA[Getting text out of your SSH sessions can be annoying.  If it fits in a screen, I usually just select the text in PuTTY to copy it&#8211; no big deal.  Otherwise, I have to either email it to myself or &#8230; <a href="http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Getting text out of your SSH sessions can be annoying.  If it fits in a screen, I usually just select the text in PuTTY to copy it&#8211; no big deal.  Otherwise, I have to either email it to myself or put it in a file, log in with WinSCP, and download the file.  Way too much trouble.</p>
<p>Today I started searching for a better solution and found a <a href="http://dmst.aueb.gr/dds/sw/windows/puttyclip/">patch for PuTTY</a> by <a href="http://dmst.aueb.gr/dds/" target="NEW">Diomidis Spinellis</a>.  Unfortunately it was for an old version of PuTTY.  However with a little effort I updated the patch to PuTTY 0.60.</p>
<p>Here&#8217;s how it works:<br />
<span id="more-142"></span></p>
<ol>
<li>Use the <a href="http://ericmason.net/putty/putty.exe">modified PuTTY</a></li>
<li>When connecting (or after) click on the Terminal setting, and under &#8220;Printer to send ANSI printer output to&#8221; select &#8220;Windows clipboard&#8221;</li>
<li>Add the following to your .bashrc (or the appropriate startup file for your shell)  To use it immediately, be sure to type &#8220;source .bashrc&#8221;
<pre class="syntax bash">
function wcl {
  echo -ne '\e''[5i'
  cat $*
  echo -ne '\e''[4i'
  echo &quot;Copied to Windows clipboard&quot; 1&gt;&amp;2
}
</pre>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">}</span></li>
<li>Now when you want some text out of SSH, just pipe it to wcl.   For instance, &#8220;ls -la |wcl&#8221; places the output of &#8220;ls -la&#8221; in your Windows clipboard.</li>
</ol>
<p><a href="http://ericmason.net/putty/putty.exe">Modified PuTTY 0.60 executable</a></p>
<p><a href="http://ericmason.net/putty/putty-0.60-clip.patch">Patch for PuTTY 0.60</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/&via=ericmason&text=PuTTY SSH / Windows Clipboard Integration&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2010/04/putty-ssh-windows-clipboard-integration/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Apt-get upgrade wants to replace my compiled packages.</title>
		<link>http://ericmason.net/2009/03/apt-get-upgrade-wants-to-replace-my-compiled-packages/</link>
		<comments>http://ericmason.net/2009/03/apt-get-upgrade-wants-to-replace-my-compiled-packages/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 20:16:40 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=102</guid>
		<description><![CDATA[I was getting some messages from my daily apt-get upgrade script telling me some of my ffmpeg debs needed to be upgraded.  Since I had recompiled ffmpeg from the source debs with different options, I re-ran apt-get source ffmpeg to &#8230; <a href="http://ericmason.net/2009/03/apt-get-upgrade-wants-to-replace-my-compiled-packages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was getting some messages from my daily apt-get upgrade script telling me some of my ffmpeg debs needed to be upgraded.  <span id="more-102"></span>Since I had recompiled ffmpeg from the source debs with different options, I re-ran <strong>apt-get source ffmpeg</strong> to get the latest source.   When nothing downloaded, I checked the latest version with apt-cache and found it matched the version I have installed.  Off to Google I went and found <a href="http://www.mail-archive.com/deity@lists.debian.org/msg04239.html">this thread</a> from 9 years ago saying the bogus upgrade messages are normal and I had to increment the version number. </p>
<p>I still want to be notified when new versions come out (via my daily upgrade script) so I can recompile it, so I updated the version as little as possible by adding an &#8220;a&#8221; to the end of it.  </p>
<p>In the source directory, I edited <strong>debian/changelog </strong>.  The first line said</p>
<p> </p>
<blockquote><p>ffmpeg (3:0.cvs20070307-5ubuntu7.3) hardy-security; urgency=low</p></blockquote>
<div>So I changed it to </div>
<div>
<blockquote>
<div>ffmpeg (3:0.cvs20070307-5ubuntu7.3<strong>a</strong>) hardy-security; urgency=low</div>
</blockquote>
<div>Then I ran <strong>fakeroot debian/rules binary </strong>and installed the resulting packages.  Now apt-get upgrade tells me I have nothing to upgrade.  As long as the ffmpeg package maintainer doesn&#8217;t use 3:0.cvs20070307-5ubuntu7.3a as the new version number, I&#8217;ll still know when a new release comes out. </div>
</div>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2009/03/apt-get-upgrade-wants-to-replace-my-compiled-packages/&via=ericmason&text=Apt-get upgrade wants to replace my compiled packages.&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2009/03/apt-get-upgrade-wants-to-replace-my-compiled-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOAP4R and SSL: unable to get local issuer certificate</title>
		<link>http://ericmason.net/2008/10/soap4r-and-ssl-unable-to-get-local-issuer-certificate/</link>
		<comments>http://ericmason.net/2008/10/soap4r-and-ssl-unable-to-get-local-issuer-certificate/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 13:16:40 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=55</guid>
		<description><![CDATA[After enabling SSL on a couple of apps, I got an email from one of my cron jobs telling me my SOAP API was no longer working.  (This is why you always want to have an entry in /etc/aliases forwarding &#8230; <a href="http://ericmason.net/2008/10/soap4r-and-ssl-unable-to-get-local-issuer-certificate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After enabling SSL on a couple of apps, I got an email from one of my cron jobs telling me my SOAP API was no longer working.  (This is why you always want to have an entry in /etc/aliases forwarding root&#8217;s email to an account you will read)</p>
<p>The error message was &#8220;unable to get local issuer certificate.&#8221;  I thought, no big deal, there must be an easy way to get SOAP4R to find all the root CA certificates.  Unfortunately it took a while searching Google to find the right answer, so I&#8217;m posting it here to make it easier for the next person (which just might be me next week).</p>
<p><span id="more-55"></span></p>
<p>It turns out SOAP4R will read a file called <strong>&#8220;soap/property&#8221;</strong> in your ruby library path (which can usually be the directory your app is in).  You can place certain configuration options in this file to control how SOAP4R behaves.  In this case, I needed to add<br />
<code><br />
client.protocol.http.ssl_config.ca_file=/etc/ssl/certs/ca-certificates.crt<br />
</code></p>
<p>This fixed the &#8220;unable to get local issuer certificate&#8221; error right away.</p>
<p>There was another problem though; it was complaining about the hostname not matching the certificate.  Since I&#8217;m using a wildcard certificate, I assume this means OpenSSL doesn&#8217;t respect wildcard certificates.  I grudgingly added this to soap/property file<br />
<code><br />
client.protocol.http.ssl_config.verify_mode=OpenSSL::SSL::VERIFY_NONE<br />
</code><br />
And it&#8217;s fine now.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2008/10/soap4r-and-ssl-unable-to-get-local-issuer-certificate/&via=ericmason&text=SOAP4R and SSL: unable to get local issuer certificate&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2008/10/soap4r-and-ssl-unable-to-get-local-issuer-certificate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multiple virtual hosts using SSL on the same IP and Port</title>
		<link>http://ericmason.net/2008/09/multiple-virtual-hosts-using-ssl-on-the-same-ip-and-port/</link>
		<comments>http://ericmason.net/2008/09/multiple-virtual-hosts-using-ssl-on-the-same-ip-and-port/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 03:08:12 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=50</guid>
		<description><![CDATA[Tonight I decided to set up SSL on two internal web apps I&#8217;ve been running for a while. I have a wildcard certificate *.stockpr.com just for this purpose. Each app was originally running on a separate hostname on a single &#8230; <a href="http://ericmason.net/2008/09/multiple-virtual-hosts-using-ssl-on-the-same-ip-and-port/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tonight I decided to set up SSL on two internal web apps I&#8217;ve been running for a while.  I have a wildcard certificate *.stockpr.com just for this purpose.  Each app was originally running on a separate hostname on a single IP address on port 80.  </p>
<p>After I started setting up SSL, I realized that I might run into trouble because <a href="http://httpd.apache.org/docs/1.3/vhosts/name-based.html">Apache has always said</a> you can&#8217;t combine NameVirtualHost and SSL.  The reason for this is that the SSL session is established before the HTTP headers are sent.  Since NameVirtualHost relies on the HTTP Host header, which is unavailable since it hasn&#8217;t yet been sent at the time SSL is being negotiated, Apache can only use a single SSL cert per combination of IP and port.<br />
<span id="more-50"></span><br />
So my thought was this should technically not be a problem since both of my hostnames are under the same domain and I have that fancy wildcard certificate for <strong>both</strong> virtual hosts.  I thought Apache just might be cool enough to send the first certificate it finds, but still respect the HTTP Host header and send the request to the right virtual host.  </p>
<p>Guess what&#8230; Apache is indeed that cool.  I now have x.stockpr.com and y.stockpr.com on the same IP and port with two different virtual hosts, sharing the same certificate.  </p>
<p>Won&#8217;t exactly revolutionize web hosting, but it definitely made my <del datetime="2008-10-01T02:54:20+00:00">day</del> night go a little easier.  (Of course if you read my <a href="http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/">last post</a>, something else more than made up for it)</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2008/09/multiple-virtual-hosts-using-ssl-on-the-same-ip-and-port/&via=ericmason&text=Multiple virtual hosts using SSL on the same IP and Port&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2008/09/multiple-virtual-hosts-using-ssl-on-the-same-ip-and-port/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Amazon EC2 and &#8220;4gb seg fixup&#8221;</title>
		<link>http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/</link>
		<comments>http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 02:49:52 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=48</guid>
		<description><![CDATA[Tonight I spent two hours banging on an EC2 instance that suddenly went awry. I was adding SSL to a couple of internal applications we host on this instance when my &#8220;apache2ctl configtest&#8221; command hung. I tried all sorts of &#8230; <a href="http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tonight I spent two hours banging on an EC2 instance that suddenly went awry.  I was adding SSL to a couple of internal applications we host on this instance when my &#8220;apache2ctl configtest&#8221; command hung.  I tried all sorts of things and finally noticed there were tons of entries in /var/log/messages referencing &#8220;4gb seg fixup&#8221; like this:<br />
<span id="more-48"></span><br />
<code>kernel: printk: 16 messages suppressed.<br />
kernel: 4gb seg fixup, process sh (pid 21236), cs:ip 73:00a7b240<br />
last message repeated 8 times<br />
kernel: printk: 353387 messages suppressed.</code></p>
<p>Google revealed that I&#8217;m not the first to run into this problem with an EC2 instance.  Several posts said to install the Xen version of libc<br />
<code><br />
apt-get install libc6-xen <br />
</code><br />
and do this:<br />
<code><br />
echo "hwcap 0 nosegneg" &gt; /etc/ld.so.conf.d/libc6-xen.conf; ldconfig<br />
</code><br />
And then reboot.</p>
<p>This seems to have fixed it, but I&#8217;m wondering why this was either not included in the Ubuntu AMI I&#8217;m using or somehow got undone.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/&via=ericmason&text=Amazon EC2 and "4gb seg fixup"&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2008/09/amazon-ec2-and-4gb-seg-fixup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bundling EC2 Instances and EBS</title>
		<link>http://ericmason.net/2008/09/bundling-ec2-instances-and-ebs/</link>
		<comments>http://ericmason.net/2008/09/bundling-ec2-instances-and-ebs/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 14:52:36 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[amazon aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://ericmason.net/?p=41</guid>
		<description><![CDATA[As I mentioned in the last post, I&#8217;m working on hosting email accounts on Amazon EC2. I am experimenting with mounting /var on an EBS volume so my database, logs, etc. will survive the failure of an instance.  The idea is &#8230; <a href="http://ericmason.net/2008/09/bundling-ec2-instances-and-ebs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in the last post, I&#8217;m working on hosting email accounts on <a href="http://aws.amazon.com/ec2">Amazon EC2</a>. I am experimenting with mounting /var on an <a href="http://aws.amazon.com/ebs">EBS</a> volume so my database, logs, etc. will survive the failure of an instance.  The idea is to be able to start a new instance, attach the EBS volume containing the /var partition, and keep going where the previous instance left off.  </p>
<p>The first time I tried to bundle the volume I noticed it was taking a very long time.  I had incorrectly assumed that ec2-bundle-vol would automatically exclude any EBS volumes.  Instead, it only excludes a static list of directories, so I had to add the EBS volume (/mail) to the exclusion list.  </p>
<p><span id="more-41"></span></p>
<p>Here are the commands I used to bundle the volume:</p>
<p><code>ec2-bundle-vol -k /mnt/aws-config/pk-xxxxx.pem   \<br />
-c /mnt/aws-config/cert-xxxx.pem  \<br />
-u xxxx-xxxx-xxxx -d /mnt/bundle \<br />
-p image-name-20080924<br />
-e /mail </code></p>
<p><code> </code></p>
<p><code>ec2-upload-bundle -b ae-ami \<br />
-m /mnt/bundle/image-name-20080924.manifest.xml \<br />
-a xxxx -s xxxx</code></p>
<p><code>ec2reg bucket-name/image-name-20080924.manifest.xml</p>
<p></code></p>
<p> </p>
<p> </p>
<p>The next step will be to figure out how to set up the AMI so it will have a swap partition when it boots up in a new instance.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://ericmason.net/2008/09/bundling-ec2-instances-and-ebs/&via=ericmason&text=Bundling EC2 Instances and EBS&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://ericmason.net/2008/09/bundling-ec2-instances-and-ebs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

