<?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>Tim's Weblog &#187; debian</title>
	<atom:link href="http://blog.hokkertjes.nl/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hokkertjes.nl</link>
	<description>Random Thoughts and Rants</description>
	<lastBuildDate>Fri, 23 Jul 2010 11:41:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>GlassFish 3.0.1′s pkg tool using Debian’s Python packages</title>
		<link>http://blog.kumina.nl/2010/07/glassfish-3-0-1s-pkg-tool-using-debians-python-packages/</link>
		<comments>http://blog.kumina.nl/2010/07/glassfish-3-0-1s-pkg-tool-using-debians-python-packages/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 11:41:07 +0000</pubDate>
		<dc:creator>Tim Stoop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[pkg]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.kumina.nl/?p=95</guid>
		<description><![CDATA[Short howto on how to use Debian's Python interpreter with GlassFish's supplied pkg tool on a 64 bit system.]]></description>
			<content:encoded><![CDATA[<p>While setting up <a href="https://glassfish.dev.java.net/">GlassFish 3.0.1</a> for a customer on <a href="http://www.debian.org">Debian Lenny</a> using 64 bit machines, I ran into the problem that the update tool shipped with GlassFish (<a href="http://www.opensolaris.com/">OpenSolaris</a>&#8216;s <a href="http://hub.opensolaris.org/bin/view/Project+pkg/WebHome">pkg tool</a>) uses a <a href="http://www.python.org">Python</a> interpreter which is part of the package. That Python interpreter however is 32 bit, which requires the ia32 libraries to be installed. Worse, it requires lididn in 32 bit, which is not part of the default Debian packages, so I had to get that one from the (very nice) <a href="http://debian-multimedia.org/dists/stable/main/binary-amd64/package/ia32-libs-libidn11.php">Debian Multimedia repository</a>. Although that&#8217;s a quick fix to get stuff working, we rather not use these repositories on production machines, due to security concerns and the like. Also, upgrades are easier if you only use the standard Debian repositories.</p>
<p>So I decided to see if I could get it working with the Debian supplied Python interpreter. One problem is that there&#8217;s a shared object file written in C which is part of the pkg application. That file is a 32 bit ELF too. So we&#8217;re going to download that source and recompile it for 64 bit. If you&#8217;re on a 32 bit system, you can skip that step (although it doesn&#8217;t hurt to do it anyway). First, we need to install the following packages:<br />
<span id="more-95"></span><br />
<code>apt-get install python2.5 python2.5-dev gcc python-cherrypy python-mako python-openssl python-ply python-pycurl python-simplejson</code></p>
<p>Now download the source for the _actions.c file from <a href="http://src.opensolaris.org/source/xref/pkg/gate/src/modules/actions/_actions.c">here</a> (link to webpage, press download in the top).</p>
<p>Compile it with the following command:<br />
<code>gcc -I/usr/include/python2.5 -shared -fpic -O2 _actions.c -o _actions.so</code></p>
<p>Keep the resulting .so file, we&#8217;re going to replace it once we&#8217;ve downloaded GlassFish. Which is the next step, actually. So download GlassFish and set it up somewhere. I downloaded the tarball and unzipped it into /opt/glassfish.</p>
<p>The resulting directory contains several directories, including a pkg and a glassfish directory. The /opt/glassfish/glassfish directory is the actual GlassFish application. The pkg directory contains the pkg tool which is used to upgrade the GlassFish addons and systems and stuff (don&#8217;t ask me about the details, I&#8217;m not a Java developer, only a sysadmin). The first time you start it, it installs some stuff. So just run the following:<br />
<code>/opt/glassfish/bin/pkg</code></p>
<p>Next, mv the file /opt/glassfish/pkg/bin/pkg to /opt/glassfish/pkg/bin/pkg.orig. We do this since this script does all kinds of magic which we do not need. Also, it runs the pkg python code with the python2.4 interpreter that&#8217;s part of the package. We don&#8217;t want that. Let&#8217;s fix it.</p>
<p>Make a simple script to replace the one we moved away. I use the following, which works for me:</p>
<pre>#!/bin/sh
python /opt/glassfish/pkg/bin/client.py</pre>
<p>If you start it now, you&#8217;ll get an error:</p>
<pre>$ python /opt/glassfish/pkg/bin/client.py
Traceback (most recent call last):
  File "/opt/glassfish/pkg/bin/client.py", line 60, in <module>
    import pkg
ImportError: No module named pkg</pre>
<p>Ok, let&#8217;s fix that! Start with creating a directory called /opt/glassfish/pkg/custom-lib. You can change the name into anything you want, of course, as long as it&#8217;s clear that this is where you&#8217;re going to put the pkg python module. Actually, let&#8217;s do that immediatly: <code>cp -r /opt/glassfish/pkg/vendor-packages/pkg /opt/glassfish/pkg/custom-lib</code></p>
<p>Change our script which we setup to run pkg into the following:</p>
<pre>#!/bin/sh
PYTHONPATH="/opt/glassfish/pkg/custom-lib" python /opt/glassfish/pkg/bin/client.py</pre>
<p>You need to have only the pkg module in there, because the PYTHONPATH variable takes precedence over the other modules installed via the Debian packages. Run the script and you&#8217;ll get a new error:</p>
<pre>Traceback (most recent call last):
  File "/opt/glassfish/pkg/bin/client.py", line 61, in <module>
    import pkg.actions as actions
  File "/opt/glassfish/pkg/custom-lib/pkg/actions/__init__.py", line 144, in <module>
    from _actions import _fromstr
ImportError: /opt/glassfish/pkg/custom-lib/pkg/actions/_actions.so: wrong ELF class: ELFCLASS32</pre>
<p>If you don&#8217;t get this error, you&#8217;re on a 32 bit system and you&#8217;re done! Congratulations! Otherwise, we&#8217;re going to copy the _actions.so file we compiled earlier over the one that&#8217;s packaged with GlassFish 3.0.1. Just copy it over the other file, like so: <code>cp _actions.so /opt/glassfish/pkg/custom-lib/pkg/actions/_actions.so</code></p>
<p>Now we&#8217;re really done! You should be able to run <code>/opt/glassfish/bin/pkg image-update</code> now and update your currently installed GlassFish 3.0.1 with the latest modules and stuff. Awesome!</p>
<p>I&#8217;m in the process of creating a Debian package for GlassFish 3.0.1 which incorporated this fix. So if you&#8217;re not in a hurry or you&#8217;re reading this way after it was posted, you might want to check out <a href="http://debian.kumina.nl">debian.kumina.nl</a> to see if the package is available.</p>
<p>Hope this helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kumina.nl/2010/07/glassfish-3-0-1s-pkg-tool-using-debians-python-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyLVMbackup: Making it cooperate with Debian</title>
		<link>http://blog.hokkertjes.nl/2009/02/24/mylvmbackup-making-it-cooperate-with-debian/</link>
		<comments>http://blog.hokkertjes.nl/2009/02/24/mylvmbackup-making-it-cooperate-with-debian/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 13:54:05 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[mylvmbackup]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=740</guid>
		<description><![CDATA[For making a consistent backup of MySQL data, mylvmbackup seems to be a great tool. It&#8217;s written in Perl and does what you would expect: Lock the tables, flush them all to disk, make a LVM snapshot and release the tables, recover the InnoDB log,make the backup from the snapshot, remove the snapshot. Minimal downtime [...]]]></description>
			<content:encoded><![CDATA[<p>For making a consistent backup of MySQL data, <a href="https://launchpad.net/mylvmbackup">mylvmbackup</a> seems to be a great tool. It&#8217;s written in Perl and does what you would expect: Lock the tables, flush them all to disk, make a LVM snapshot and release the tables, recover the InnoDB log,make the backup from the snapshot, remove the snapshot. Minimal downtime and still a consistent backup. Although it&#8217;s fairly new, it looks good.</p>
<p>There&#8217;s even a Debian package for it, but that doesn&#8217;t really contain everything I need. First of all, I need a package that runs on Etch. There&#8217;s a dependency in the Debian package (which is for Lenny) on an asciidoc of a version that&#8217;s available only in Lenny. I don&#8217;t really see why that dependency is there at all, but when removing the version, the package still works as expected.</p>
<p>Also, I made two patches of which one is not needed at all, but I left it in there anyway, because it doesn&#8217;t break anything. It simply adds the &#8211;innodb-file-per-table option to the invocation of the mysqld_safe daemon, but that&#8217;s not needed since it only affects MySQL when you change data. But since mysqld_safe is used to recover from logs, you won&#8217;t be changing data. I left it in there anyway. You can find the dpatch file <a href="http://tim.hokkertjes.nl/mylvmbackup-patches/03_add_innodb-file-per-table_option.dpatch">here</a>.</p>
<p>The second one might be more interesting. The mysql-server-5.0 package from Debian creates a file /etc/mysql/debian.cnf with login details for the debian-sys-maint user. This user also has enough permissions to do all the things necessary for manipulating the database when we want to make a backup with mylvmbackup. Normally, mylvmbackup needs you to give it user details for a privileged user in /etc/mylvmbackup.conf, which is a bit double, since the debian.cnf exists. So my patch adds a &#8211;defaults_file option which allows you to mention the debian.cnf. No need for more passwords in plaintext on the filesystem! You can either give this option no the commandline or in the mylvmbackup.conf in the [mysql] section. It only supports Debian style debian.cnf, though, since it searched for a [client] section in the file you mention. You can find the patch <a href="http://tim.hokkertjes.nl/mylvmbackup-patches/04_use_defaults-file_by_default.dpatch">here</a>.</p>
<p>A working package can be found in <a href="http://debian.kumina.nl">Kumina&#8217;s Debian repository</a> for both etch and lenny. Please let me know if this works for you! It&#8217;s my first Perl, though, so be warned. If stuff breaks&#8230; Well&#8230; Sorry&#8230; So be sure to test it.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/backup' rel='tag' target='_self'>backup</a>, <a class='technorati-link' href='http://technorati.com/tag/configuration' rel='tag' target='_self'>configuration</a>, <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/etch' rel='tag' target='_self'>etch</a>, <a class='technorati-link' href='http://technorati.com/tag/lenny' rel='tag' target='_self'>lenny</a>, <a class='technorati-link' href='http://technorati.com/tag/mylvmbackup' rel='tag' target='_self'>mylvmbackup</a>, <a class='technorati-link' href='http://technorati.com/tag/mysql' rel='tag' target='_self'>mysql</a>, <a class='technorati-link' href='http://technorati.com/tag/package' rel='tag' target='_self'>package</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2009/02/24/mylvmbackup-making-it-cooperate-with-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Sarge: LVM2 snapshot (removal)</title>
		<link>http://blog.hokkertjes.nl/2009/01/09/debian-sarge-lvm2-snapshot-removal/</link>
		<comments>http://blog.hokkertjes.nl/2009/01/09/debian-sarge-lvm2-snapshot-removal/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 14:37:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[sarge]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=633</guid>
		<description><![CDATA[I had some troubles with removing an LVM snapshot from within a Debian Sarge domU. It would lock up the domU completely, without removing the snapshot. A bit of a problem, especially since this was a production machine. So I destroyed the domU and tried again, with the same results, unfortunately. Bart found a description [...]]]></description>
			<content:encoded><![CDATA[<p>I had some troubles with removing an LVM snapshot from within a Debian Sarge domU. It would lock up the domU completely, without removing the snapshot. A bit of a problem, especially since this was a production machine. So I destroyed the domU and tried again, with the same results, unfortunately.</p>
<p>Bart found a description of the problem and the solution at <a href="http://blog.blackdown.de/2006/04/09/lvm-snapshots-with-debian-sarge-and-linux-2616/">J&uuml;rgen Kreileder&#8217;s blog</a>. J&uuml;rgen apparantly still has the repos online, which helped us resolve the problem on our machine. Much appreciated!</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/lvm' rel='tag' target='_self'>lvm</a>, <a class='technorati-link' href='http://technorati.com/tag/sarge' rel='tag' target='_self'>sarge</a>, <a class='technorati-link' href='http://technorati.com/tag/solution' rel='tag' target='_self'>solution</a>, <a class='technorati-link' href='http://technorati.com/tag/xen' rel='tag' target='_self'>xen</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2009/01/09/debian-sarge-lvm2-snapshot-removal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Debian Sarge to Etch: ColdFusionMX7 is a pain</title>
		<link>http://blog.hokkertjes.nl/2009/01/05/upgrade-debian-sarge-to-etch-coldfusionmx7-is-a-pain/</link>
		<comments>http://blog.hokkertjes.nl/2009/01/05/upgrade-debian-sarge-to-etch-coldfusionmx7-is-a-pain/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 14:07:18 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[apache22]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[coldfusionmx7]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[jrun]]></category>
		<category><![CDATA[mod_jrun22]]></category>
		<category><![CDATA[sarge]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=616</guid>
		<description><![CDATA[So we&#8217;re finally getting around to upgrading an old Debian Sarge server which runs ColdFusionMX7 to Etch. The Debian part is easy, I simply edit the sources.list and do an apt-get dist-upgrade and some questions later, presto, the machine is a working Debian Etch machine. Getting ColdFusionMX7 to run with the Etch supplied Apache 2.2 [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;re finally getting around to upgrading an old Debian Sarge server which runs ColdFusionMX7 to Etch. The Debian part is easy, I simply edit the sources.list and do an apt-get dist-upgrade and some questions later, presto, the machine is a working Debian Etch machine.</p>
<p>Getting ColdFusionMX7 to run with the Etch supplied Apache 2.2 is a different matter. Took me about several weeks to find out (not full time, but still over 20 hours, I think). First of all, you need the modified wsconfig.jar that Adobe distributes via <a href="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=8001e97">a knowledge base article about their hotfix</a>. Don&#8217;t bother with their instructions, though, the mod_jrun22.so will not compile that way. Not because of missing apps or something, but because for some strange reason, the script thinks JRun is already up and running. I get an output like so:</p>
<pre>Macromedia JRun 4.0 (Build 107948)
os.name: Linux
os.version: 2.6.18-6-xen-amd64
os.arch: i386
platform: intel-linux
Found port 2920 on host localhost
findServers(): found server coldfusion at 127.0.0.1:2920
Found JRun server coldfusion at 127.0.0.1:2920
this host is stage02:62.133.201.114
web server: Apache
web server directory: /etc/apache2
verbose connector logging: false
apialloc: false
force resource extract from jar: true
CFMX: true
mappings: .jsp,.jws,.cfm,.cfml,.cfc,.cfr,.cfswf
filter mapping prefix: false
Apache binary: /usr/sbin/apache2
Apache control script: /usr/sbin/apache2ctl
Apache apxs: true
This web server is already configured for JRun.</pre>
<p>Not very helpful. I tried removing all files related to Apache and JRun that I could think of, including the part in /etc/apache2/httpd.conf that loads the module, but it still told me that the web server was already configured. Time for some heavier work.</p>
<p>First, start with unzipping the wsconfig.zip. It&#8217;ll yield a wsconfig.jar. Unzip that one too in a temporary directory, let&#8217;s say in /tmp/wsconfig. Now go to /tmp/wsconfig/controller/src. There&#8217;s a text file in there that contains the steps to install it. However, I need to install a few packages:</p>
<pre>apt-get install apache2-prefork-dev gcc</pre>
<p>You might need apache2-worker-dev, if you use that Apache flavour. You can check that with <code>dpkg -l | grep apache2</code>. You&#8217;ll find either apache2-mpm-prefork or apache2-mpm-worker. That&#8217;s your clue!</p>
<p>Now, execute the following commands:</p>
<pre>sudo apxs2 -c -n jrun22 mod_jrun22.c  \
jrun_maptable_impl.c  jrun_property.c  jrun_session.c platform.c \
jrun_mutex.c jrun_proxy.c  jrun_utils.c

sudo apxs2 -i -n jrun22 mod_jrun22.la

sudo strip /usr/lib/apache2/modules/mod_jrun22.so</pre>
<p>This will install the Apache 2.2 JRun module at /usr/lib/apache2/modules/mod_jrun22.so. Now change your Apache config accordingly, and you&#8217;re ready to go.</p>
<p>One thing I found, but that was just me trying to be hasty, was that you need to use:</p>
<pre>LoadModule <b>jrun_module</b> /usr/lib/apache2/modules/mod_jrun22.so</pre>
<p>Hope this helps someone.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/apache22' rel='tag' target='_self'>apache22</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion' rel='tag' target='_self'>coldfusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusionmx7' rel='tag' target='_self'>coldfusionmx7</a>, <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/etch' rel='tag' target='_self'>etch</a>, <a class='technorati-link' href='http://technorati.com/tag/jrun' rel='tag' target='_self'>jrun</a>, <a class='technorati-link' href='http://technorati.com/tag/mod_jrun22' rel='tag' target='_self'>mod_jrun22</a>, <a class='technorati-link' href='http://technorati.com/tag/sarge' rel='tag' target='_self'>sarge</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2009/01/05/upgrade-debian-sarge-to-etch-coldfusionmx7-is-a-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shrinking a MySQL ibdata1 file</title>
		<link>http://blog.hokkertjes.nl/2008/12/10/shrinking-a-mysql-ibdata1-file/</link>
		<comments>http://blog.hokkertjes.nl/2008/12/10/shrinking-a-mysql-ibdata1-file/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 07:00:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=590</guid>
		<description><![CDATA[MySQL&#8217;s InnoDB engine stores all tables by default in one large file which is located (in Debian) under /var/lib/mysql/ibdata1. This file allocates some diskspace (in Debian it defaults to 10M chunks), but never unallocates the disk space. So if you make a few large tables, your partition might get full. Removing those large tables doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL&#8217;s InnoDB engine stores all tables by default in one large file which is located (in Debian) under /var/lib/mysql/ibdata1. This file allocates some diskspace (in Debian it defaults to 10M chunks), but never unallocates the disk space. So if you make a few large tables, your partition might get full. Removing those large tables doesn&#8217;t help a thing, since the ibdata1 file is never shrunken by MySQL&#8217;s InnoDB engine. I needed to shrink it, preferably with as little as possible downtime.</p>
<p>It is nigh impossible. I&#8217;ve tried several things. First, I added the option <code>innodb_file_per_table</code>. The idea was to optimize each table, so it would be rewritten into a separate file. Then delete the ibdata1 file and it&#8217;s logs and restart MySQL. This worked in a simple test setup, but failed miserably in the production environment. I have no idea what went wrong, but even when I restored the old ibdata1 and it&#8217;s logs, it wouldn&#8217;t work anymore. Chaos and mayhem all around. Joy.</p>
<p>So I resorted to the only other solution I could find: Make a dump of the complete database and remove all files in /var/lib/mysql, then restart MySQL and restore the dump. Not a very practical solution, but the only one that seems to work reliably.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/innodb' rel='tag' target='_self'>innodb</a>, <a class='technorati-link' href='http://technorati.com/tag/mysql' rel='tag' target='_self'>mysql</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/12/10/shrinking-a-mysql-ibdata1-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NFS file locking</title>
		<link>http://blog.hokkertjes.nl/2008/12/09/nfs-file-locking/</link>
		<comments>http://blog.hokkertjes.nl/2008/12/09/nfs-file-locking/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 07:00:10 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[locking]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[statd]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=584</guid>
		<description><![CDATA[Sometimes you need file locking over NFS. In my case, I needed it for running MySQL tables via NFS. Even though you can tell MySQL to not do external locking, this setting is ignored when you use InnoDB. That&#8217;s not a very well documented feature. So you need to make sure locking is available. I [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need file locking over NFS. In my case, I needed it for running MySQL tables via NFS. Even though you can tell MySQL to not do external locking, this setting is ignored when you use InnoDB. That&#8217;s not a very well documented feature. So you need to make sure locking is available.</p>
<p>I did most of my debugging with <a href="http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1228698819531+28353475&#038;threadId=216422">a small perl script that I found on the HP forums</a>. Simply edit the location and you&#8217;re ready to go. My problem was that I had no trouble at all getting it to work in another setup, but I couldn&#8217;t find at first what was different in the production setup. In the end it was very obvious (as it usually is): The network was way more complicated.</p>
<p>The setup I&#8217;m talking about is in a datacentre that houses several of our customers. They&#8217;re all daughter-companies from one large one, so they&#8217;re okay with sharing some infrastructure. But each company has it&#8217;s own domain name and prefers of course to use that one. Now, we name our virtual machines (we do everything virtualised) after their specific function, so a database master would be called something like <code>dbm1.customera.com</code>. Another customer with another database master would call the machine <code>dbm1.customerb.com</code>. But when we&#8217;re working in that network, it&#8217;s annoying to use those full names, so we have an internal DNS that resolves things like <code>dbm1.custa</code> and <code>dbm1.custb</code>. Just for convenience.</p>
<p>But that convenience is what made NFS locking break. Since the machine would report it&#8217;s hostname as being <code>dbm1.customera.com</code>, while it&#8217;s DNS name would be <code>dbm1.custa</code>. Apparantly, NFS can&#8217;t handle that very well.</p>
<p>Luckily, there&#8217;s an easy solution: Add a specific hostname to the NFS stat daemon. In Debian, you do that by editing /etc/default/nfs-common (after you installed the nfs-common package) and adding the following line: <code>STATDOPTS="-n dbm1"</code></p>
<p>That worked for me. Now, I have working InnoDB tables on an NFS share.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/innodb' rel='tag' target='_self'>innodb</a>, <a class='technorati-link' href='http://technorati.com/tag/locking' rel='tag' target='_self'>locking</a>, <a class='technorati-link' href='http://technorati.com/tag/mysql' rel='tag' target='_self'>mysql</a>, <a class='technorati-link' href='http://technorati.com/tag/nfs' rel='tag' target='_self'>nfs</a>, <a class='technorati-link' href='http://technorati.com/tag/statd' rel='tag' target='_self'>statd</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/12/09/nfs-file-locking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL on Lenny and permissions</title>
		<link>http://blog.hokkertjes.nl/2008/08/22/mysql-on-lenny-and-permissions/</link>
		<comments>http://blog.hokkertjes.nl/2008/08/22/mysql-on-lenny-and-permissions/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 09:40:59 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[a_bit_strange]]></category>
		<category><![CDATA[credentials]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[permissions]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=501</guid>
		<description><![CDATA[Ok, had something strange that I think is worth a share. I just upgraded a virtual machine to Lenny and installed MySQL and phpMyAdmin and apache and the like. Created a user for a Django project I&#8217;m working on and it couldn&#8217;t connect. I tried resetting the password several times, didn&#8217;t help. Then, out of [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, had something strange that I think is worth a share. I just upgraded a virtual machine to <a href="http://www.debian.org/releases/lenny/">Lenny</a> and installed MySQL and phpMyAdmin and apache and the like. Created a user for a Django project I&#8217;m working on and it couldn&#8217;t connect. I tried resetting the password several times, didn&#8217;t help. Then, out of frustration, I tried connecting without a password and&#8230; it worked!</p>
<p>Apparantly, by default, the MySQL in Lenny created access rules that allow all local users to access the database without a password. These have priority over the specific user controls. A bit unexpected and I suspect others to run into this. Could make you search for a problem if you&#8217;re installing a shared webhosting machine with a local MySQL database.</p>
<p>Solution:<br />
<code>delete from mysql.user where User='';</code></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/a_bit_strange' rel='tag' target='_self'>a_bit_strange</a>, <a class='technorati-link' href='http://technorati.com/tag/credentials' rel='tag' target='_self'>credentials</a>, <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/fix' rel='tag' target='_self'>fix</a>, <a class='technorati-link' href='http://technorati.com/tag/lenny' rel='tag' target='_self'>lenny</a>, <a class='technorati-link' href='http://technorati.com/tag/mysql' rel='tag' target='_self'>mysql</a>, <a class='technorati-link' href='http://technorati.com/tag/permissions' rel='tag' target='_self'>permissions</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/08/22/mysql-on-lenny-and-permissions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian&#8217;s Trac: &#8220;SubversionException: (&#8216;No such revision 1&#8242;, 160006)&#8221;</title>
		<link>http://blog.hokkertjes.nl/2008/08/18/debians-trac-subversionexception-no-such-revision-1-160006/</link>
		<comments>http://blog.hokkertjes.nl/2008/08/18/debians-trac-subversionexception-no-such-revision-1-160006/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 06:28:39 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[SubversionException]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=496</guid>
		<description><![CDATA[A bit annoying, but the workaround (fix?) is easy. Edit /var/lib/python-support/python2.4/trac/versioncontrol/cache.py, line 114. You&#8217;ll see pass there, change it into return. Fixed. Also described in Debian bugreport #438864. Took me a while to find it, so referencing it here. Tags: debian, subversion, SubversionException, trac, workaround]]></description>
			<content:encoded><![CDATA[<p>A bit annoying, but the workaround (fix?) is easy. Edit <tt>/var/lib/python-support/python2.4/trac/versioncontrol/cache.py</tt>, line 114. You&#8217;ll see <tt>pass</tt> there, change it into <tt>return</tt>. Fixed.</p>
<p>Also described in <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=438864">Debian bugreport #438864</a>. Took me a while to find it, so referencing it here.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/subversion' rel='tag' target='_self'>subversion</a>, <a class='technorati-link' href='http://technorati.com/tag/SubversionException' rel='tag' target='_self'>SubversionException</a>, <a class='technorati-link' href='http://technorati.com/tag/trac' rel='tag' target='_self'>trac</a>, <a class='technorati-link' href='http://technorati.com/tag/workaround' rel='tag' target='_self'>workaround</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/08/18/debians-trac-subversionexception-no-such-revision-1-160006/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL on S3&#8230; not yet</title>
		<link>http://blog.hokkertjes.nl/2008/05/26/mysql-on-s3-not-yet/</link>
		<comments>http://blog.hokkertjes.nl/2008/05/26/mysql-on-s3-not-yet/#comments</comments>
		<pubDate>Mon, 26 May 2008 19:41:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/?p=489</guid>
		<description><![CDATA[Ok, I&#8217;ve been playing with EC2 and S3. Using quite a long and complicated script to create an AMI (which is Amazon&#8217;s term for a disk image). The script is coming along nicely, using debootstrap to create a Debian etch image. Yesterday and today (well, only in the evening today), I&#8217;ve been trying to get [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I&#8217;ve been playing with EC2 and S3. Using quite a long and complicated script to create an AMI (which is Amazon&#8217;s term for a disk image). The script is coming along nicely, using debootstrap to create a Debian etch image.</p>
<p>Yesterday and today (well, only in the evening today), I&#8217;ve been trying to get MySQL working on an <a href="http://code.google.com/p/s3fs/">s3fs drive</a>, but I&#8217;m afraid that&#8217;s not going to work. Well, part of it might be because I&#8217;m trying to set it up from home and not from an EC2 instance, but still. MySQL just refuses to start with a weird message:</p>
<p><code>Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!<br />
invoke-rc.d: initscript mysql, action "start" failed.</code></p>
<p>After which it hangs, altough it seems like MySQL did start. Maybe it&#8217;s something with the initscript. I realised in the end that I don&#8217;t really need MySQL running in such a setup. Making dumps every so often should be enough for what we have in mind. So I&#8217;m going to script an automatic recovery of the database, based on a dump every 5 minutes. That should work without losing any speed.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/ec2' rel='tag' target='_self'>ec2</a>, <a class='technorati-link' href='http://technorati.com/tag/mysql' rel='tag' target='_self'>mysql</a>, <a class='technorati-link' href='http://technorati.com/tag/s3' rel='tag' target='_self'>s3</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/05/26/mysql-on-s3-not-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>check_ldap with starttls for Nagios</title>
		<link>http://blog.hokkertjes.nl/2005/04/12/check_ldap-with-starttls-for-nagios/</link>
		<comments>http://blog.hokkertjes.nl/2005/04/12/check_ldap-with-starttls-for-nagios/#comments</comments>
		<pubDate>Tue, 12 Apr 2005 19:18:39 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.cidev.nl/~cvd/wordpress/?p=122</guid>
		<description><![CDATA[Since we use Nagios to monitor services and hosts with customers and OpenLDAP for accounts, we&#8217;d like to check if LDAP is still active and working. But we had a problem here, because the check_ldap plugin that&#8217;s distributed in Debian&#8216;s nagios-plugins package doesn&#8217;t speak STARTTLS. So I modified the source-code of check_ldap and created check_ldap_starttls. [...]]]></description>
			<content:encoded><![CDATA[<p>Since we use <a href="http://www.nagios.org" target="_blank">Nagios</a> to monitor services and hosts with customers and <a href="http://www.openldap.org" target="_blank">OpenLDAP</a> for accounts, we&#8217;d like to check if LDAP is still active and working. But we had a problem here, because the check_ldap plugin that&#8217;s distributed in <a href="http://www.debian.org" target="_blank">Debian</a>&#8216;s nagios-plugins package doesn&#8217;t speak <abbr title="A secure way of talking server-to-server, encrypted with TLS">STARTTLS</abbr>. So I modified the source-code of check_ldap and created check_ldap_starttls. Some might (and have) argue that using ldaps:// would be easier to implement, but that&#8217;s a non-argument, for as far as we&#8217;re concerned, since <a href="http://www.openldap.org/faq/data/cache/605.html" target="_blank">ldaps:// is deprecated</a>.</p>
<p>As usual, you can find my files right here. I claim no copyright to the code whatsoever, since I only added about 8 lines and most of those were copied from some other programme. Use as you see fit.</p>
<ul>
<li><a href="#">check_ldap_starttls</a> (the programme)
</li>
<li><a href="#">check_ldap_starttls.c</a> (the code)
</li>
</ul>
<p>Enjoy!</p>
<p><b>Update</b> Been fixed in the latest packages, I believe. Removed the links here.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/debian' rel='tag' target='_self'>debian</a>, <a class='technorati-link' href='http://technorati.com/tag/ldap' rel='tag' target='_self'>ldap</a>, <a class='technorati-link' href='http://technorati.com/tag/nagios' rel='tag' target='_self'>nagios</a>, <a class='technorati-link' href='http://technorati.com/tag/ssl' rel='tag' target='_self'>ssl</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2005/04/12/check_ldap-with-starttls-for-nagios/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
