<?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>Way of the exploding head &#187; Desktop Linux</title>
	<atom:link href="http://warmcat.com/_wp/category/desktop-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://warmcat.com/_wp</link>
	<description>Embedded and desktop Linux</description>
	<lastBuildDate>Fri, 12 Feb 2010 23:49:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>selinux magic for gitweb</title>
		<link>http://warmcat.com/_wp/2007/09/05/selinux-magic-for-gitweb/</link>
		<comments>http://warmcat.com/_wp/2007/09/05/selinux-magic-for-gitweb/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 20:25:28 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=36</guid>
		<description><![CDATA[The last remaining problem for the F7 upgrade was a conflict between getweb cgi and selinux.  I fixed it by allowing the transgression that was reported in the log.  There is quite a bit of conflicting information on the web for how to make a local policy change.
First I found out what would [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/elbow.png" align=left hspace=5>The last remaining problem for the F7 upgrade was a conflict between getweb cgi and selinux.  I fixed it by allowing the transgression that was reported in the log.  There is quite a bit of conflicting information on the web for how to make a local policy change.</p>
<p>First I found out what would allow the action that was being defeated using audit2allow</p>
<p><code><strong># echo "avc:  denied  { read } for  pid=3736 comm="gitweb.cgi" name="cgi-bin" dev=md7 ino=5079272 scontext=system_u:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:httpd_sys_script_exec_t:s0 tclass=dir" | audit2allow</strong><br />
#============= httpd_sys_script_t ==============<br />
allow httpd_sys_script_t httpd_sys_script_exec_t:dir read;<br />
</code></p>
<p>Basically the gitweb cgi calls some perl that does the equivalent of getcwd(), and this was being disallowed.  The advice that was correct for setting local policy on F7 was found <a href="http://docs.fedoraproject.org/selinux-faq-fc5/">here</a>.  In short I did</p>
<p><code># <strong>mkdir /root/tmp; cd /root/tmp</strong><br />
# <strong>touch local.te local.if local.fc</strong><br />
# <strong>yum install selinux-policy-devel</strong><br />
# <strong>vi local.te</strong><br />
policy_module(local, 1.0)</p>
<p>require {<br />
        attribute httpdcontent;<br />
        type httpd_sys_script_t;<br />
        type httpd_sys_script_exec_t;<br />
}<br />
allow httpd_sys_script_t httpd_sys_script_exec_t:dir read;<br />
# <strong>make -f /usr/share/selinux/devel/Makefile</strong><br />
# <strong>semodule -i local.pp</strong></code></p>
<p>Immediately after doing this gitweb was back working normally again.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2007/09/05/selinux-magic-for-gitweb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcing 1&amp;1 to make F7</title>
		<link>http://warmcat.com/_wp/2007/09/05/forcing-11-to-make-f7/</link>
		<comments>http://warmcat.com/_wp/2007/09/05/forcing-11-to-make-f7/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 13:56:06 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=35</guid>
		<description><![CDATA[The new server at 1&#038;1 has been showing signs of unreliability, it has crashed and died mysteriously three times, the last while I was away for a couple of days.  Late at night when I got back, I decided it was time to actually make it into a Fedora box with a kernel later [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/running-man.png" align=left>The new server at 1&#038;1 has been showing signs of unreliability, it has crashed and died mysteriously three times, the last while I was away for a couple of days.  Late at night when I got back, I decided it was time to actually make it into a Fedora box with a kernel later than 2.6.16 and to get rid of the xfs-formatted partitions, which I suspect of causing the instability.  So here are my notes on how to force-upgrade the weird FC4-based OS on those boxes to fully true Fedora 7, grub, ext3 and selinux.  The notes might not be complete, but they contain all the major steps and will be useful for anyone contemplating changing their server over to &#8220;Genuine Fedora&#8221;.</p>
<p><strong>Don&#8217;t embark on this unless you have some Linux-fu and know how to get yourself out of trouble, because at every step you can easily trash your server and lose all your data.  We are literally going to format the main filesystems and install a new bootloader on a remote server&#8230; we can call that &#8220;not a beginner project&#8221;.</strong></p>
<p><span id="more-35"></span></p>
<h3>Sanity check that we have the same layout</h3>
<p>Zero&#8217;th move is a sanity check.  Confirm that your 1&#038;1 server still has the same Raid 1 layout (the result of fdisk /dev/sd[a-b] and pressing p):</p>
<p><code>Disk /dev/sda: 160.0 GB, 160041885696 bytes<br />
255 heads, 63 sectors/track, 19457 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1               1         123      987966   fd  Linux raid autodetect<br />
/dev/sda2             124         367     1959930   82  Linux swap / Solaris<br />
/dev/sda4             368       19457   153340425    5  Extended<br />
/dev/sda5             368         976     4891761   fd  Linux raid autodetect<br />
/dev/sda6             977        1585     4891761   fd  Linux raid autodetect<br />
/dev/sda7            1586       19457   143556808+  fd  Linux raid autodetect</p>
<p>Disk /dev/sdb: 160.0 GB, 160041885696 bytes<br />
255 heads, 63 sectors/track, 19457 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1         123      987966   fd  Linux raid autodetect<br />
/dev/sdb2             124         367     1959930   82  Linux swap / Solaris<br />
/dev/sdb4             368       19457   153340425    5  Extended<br />
/dev/sdb5             368         976     4891761   fd  Linux raid autodetect<br />
/dev/sdb6             977        1585     4891761   fd  Linux raid autodetect<br />
/dev/sdb7            1586       19457   143556808+  fd  Linux raid autodetect</p>
<p># mount<br />
/dev/md1 on / type ext3 (rw)<br />
none on /proc type proc (rw)<br />
devpts on /dev/pts type devpts (rw,gid=5,mode=620)<br />
/dev/md5 on /usr type xfs (rw)<br />
/dev/md7 on /var type xfs (rw,usrquota)<br />
none on /tmp type tmpfs (rw)<br />
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)<br />
</code></p>
<p>If that is the same you are in with a chance with these instructions.</p>
<h3>Create missing raid config file</h3>
<p>First create /etc/mdadm.conf &#8230; NOT /etc/mdadm/mdadm.conf</p>
<p><code>ARRAY /dev/md5 devices=/dev/sda5,/dev/sdb5<br />
ARRAY /dev/md6 devices=/dev/sda6,/dev/sdb6<br />
ARRAY /dev/md7 devices=/dev/sda7,/dev/sdb7<br />
ARRAY /dev/md1 devices=/dev/sda1,/dev/sdb1</code></p>
<p>Grub will need this later and mkinitrd in the next step for the new kernel will use it also.</p>
<h3>Dist-upgrade to F7</h3>
<p>Next move is to dist-upgrade to F7 from inside the mutant FC4 environment.</p>
<p><code># <strong>wget http://www.mirrorservice.org/sites/download.fedora.\<br />
redhat.com/pub/fedora/linux/releases/7/Fedora/i386/os/\<br />
Fedora/fedora-release-7-3.noarch.rpm</strong><br />
# <strong>rpm -Uvf --nodeps fedora-release-7-3.noarch.rpm</strong><br />
# <strong>yum clean all</strong><br />
# <strong>yum update yum</strong><br />
# <strong>yum update</strong><br />
# <strong>yum install grub</strong></code></p>
<p>This package contains the yum repo set down /etc/yum.repos.d configured for Fedora 7 repos.  So the next yum update you do is going to &#8220;update&#8221; you to F7 since all the packages it can see are now of F7 vintage.  However, on reboot, you are going to come back up in the old mutant 2.6.16 Debian kernel.  If you try to use the Fedora kernel, you will have immediate deadly trouble with lilo and xfs support.  Nice &#8220;Fedora&#8221; they got there, with freaking lilo.</p>
<h3>Reformatting all xfs into ext3</h3>
<p>Next move is to get rid of this xfs-format crud and replace it with ext3.  I started out doing it inside the normal boot environment for /usr, and then was forced to change to using the rescue environment to do /var, so I will describe both ways as I did them.  </p>
<p>I logged into the serial console from my local machine here using</p>
<p><code>$ <strong>ssh (magic userid)@sercon.onlinehome-server.info</strong></code></p>
<p>and gave my &#8220;original root password&#8221;.  You can find this and the (magic userid) in your 1&#038;1 control panel under &#8220;serial console&#8221;</p>
<p>Then I logged into the box there using my real root credentials, and did</p>
<p><code># <strong>telinit 1</strong></code></p>
<p>this will kill all your networking and disable all services.  Confirm everything went down with ps -Af and kill anything that is still up, except your sh session.</p>
<p>Now we get rid of any junk in the yum cache and then backup /var</p>
<p><code>sh-3.1# <strong>yum clean all</strong><br />
sh-3.1# <strong>tar czf /usr/backup-var.tar.gz /var</strong><br />
sh-3.1# <strong>umount /var</strong></code></p>
<p>At this point, the 2.6.16 weirdo kernel blew a warning, which I ignored because that XFS formatted filesystem is about to get a well-deserved deletion</p>
<p><code>Badness in mutex_destroy at kernel/mutex-debug.c:458</p>
<p>Call Trace: <ffffffff8014557f>{mutex_destroy+109} <ffffffff802593f4>{xfs_qm_destroy+140}<br />
       <ffffffff802594ed>{xfs_qm_rele_quotafs_ref+165} <ffffffff8025a265>{xfs_qm_destroy_quotainfo+18}<br />
       <ffffffff80298c4a>{xfs_mount_free+160} <ffffffff80299feb>{xfs_unmountfs+171}<br />
       <ffffffff8029f4a3>{xfs_unmount+275} <ffffffff802af365>{vfs_unmount+34}<br />
       <ffffffff802aee50>{linvfs_put_super+49} <ffffffff801755c7>{generic_shutdown_super+153}<br />
       <ffffffff801760b1>{kill_block_super+36} <ffffffff80175495>{deactivate_super+103}<br />
       <ffffffff80188952>{sys_umount+111} <ffffffff8010b4f1>{error_exit+0}<br />
       <ffffffff8010a85e>{system_call+126}</code></p>
<p>Oh well, let&#8217;s destroy the /var filesystem by rewriting it ext3.</p>
<p><code>sh-3.1# <strong>mkfs.ext3 /dev/md7</strong><br />
mke2fs 1.39 (29-May-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
17956864 inodes, 35889184 blocks<br />
1794459 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=4294967296<br />
1096 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16384 inodes per group<br />
Superblock backups stored on blocks:<br />
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
        4096000, 7962624, 11239424, 20480000, 23887872</p>
<p>Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information:<br />
done</p>
<p>This filesystem will be automatically checked every 39 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.</code></p>
<p>Edit <strong>/etc/fstab</strong> to reflect our change (shows from -> to)</p>
<p><code>/dev/md7        /var    xfs     defaults,usrquota       0       2<br />
<strong>/dev/md7        /var    ext3    defaults       0       2</strong></code></p>
<p>Okay now we mount our clean empty ext3 /var back in place</p>
<p><code>sh-3.1# <strong>mount /var</strong><br />
kjournald starting.  Commit interval 5 seconds<br />
EXT3 FS on md7, internal journal<br />
EXT3-fs: mounted filesystem with ordered data mode.<br />
sh-3.1# <strong>ll /var</strong><br />
total 16<br />
drwx------ 2 root root 16384 Sep  4 20:49 lost+found<br />
sh-3.1# <strong>cd /</strong><br />
sh-3.1# <strong>tar zxf /usr/backup-var.tar.gz</strong><br />
sh-3.1# <strong>rm /usr/backup-var.tar.gz</strong></code></p>
<p>At this point /var is back how it was, but it is now on ext3.  Now we backup /usr and /home into our nice new /var</p>
<p><code>sh-3.1# <strong>rsync -a /usr /var</strong><br />
sh-3.1# <strong>rsync -a /home /var</strong></code></p>
<p>Now unfortunately I was unable to get /usr into a state that I could umount it cleanly&#8230; the sh had handles open to /usr/lib/ libraries.  So I had to use a different technique to reformat /usr and /home in place.</p>
<p>Go to your 1&#038;1 control panel and select the &#8220;recovery tool&#8221; option.  Make sure &#8220;reboot now&#8221; is unchecked, and select &#8220;Linux Rescue System (debian/woody &#8211; 2.6.x) &#8220;.  Confirm it and you will get a one-time login password generated for the rescue system.  Wait a couple of minutes and then</p>
<p><code>sh-3.1# <strong>shutdown -r now</strong></code></p>
<p>your server.  When it reboots, it will come up in the recovery system, which is a network boot with none of your local partitions mounted&#8230; this is most excellent and a really powerful solution for the kind of work we are doing on this server.  However, save yourself some time and go back to the &#8220;recovery tool&#8221; page now, and again with &#8220;reboot now&#8221; unchecked, select &#8220;Normal System&#8221; again and confirm it.  Otherwise you keep coming back into the rescue system in future boots too.</p>
<p>Next we reformat the /usr partition, /dev/md5</p>
<p><code>rescue:~# <strong>mkfs.ext3 /dev/md5</strong><br />
mke2fs 1.40-WIP (14-Nov-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
611648 inodes, 1222912 blocks<br />
61145 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=1254096896<br />
38 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16096 inodes per group<br />
Superblock backups stored on blocks:<br />
        32768, 98304, 163840, 229376, 294912, 819200, 884736</p>
<p>Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done</p>
<p>This filesystem will be automatically checked every 22 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.</code></p>
<p>Let&#8217;s mount our new, empty ext3 /usr partition at /mnt in the rescue filesystem</p>
<p><code>rescue:~# <strong>mount /dev/md5 /mnt</strong><br />
kjournald starting.  Commit interval 5 seconds<br />
EXT3 FS on md5, internal journal<br />
EXT3-fs: mounted filesystem with ordered data mode.</code></p>
<p>and we can mount our ext3 /var partition we made earlier at /opt</p>
<p><code>rescue:~# <strong>mount /dev/md7 /opt</strong><br />
kjournald starting.  Commit interval 5 seconds<br />
EXT3 FS on md7, internal journal<br />
EXT3-fs: recovery complete.<br />
EXT3-fs: mounted filesystem with ordered data mode.</code></p>
<p>Restore the contents of /usr from the copy we made in /var, and nuke the redundant copy: finally unmount the new, filled /usr</p>
<p><code>rescue:~# <strong>rsync -a /opt/usr/* /mnt</strong><br />
rescue:~# <strong>rm -rf /opt/usr</strong><br />
rescue:~# <strong>umount /mnt</strong></code></p>
<p>Do the same for /home</p>
<p><code>rescue:~# <strong>mkfs.ext3 /dev/md6</strong><br />
rescue:~# <strong>mount /dev/md6 /mnt</strong><br />
rescue:~# <strong>rsync -a /opt/home/* /mnt</strong><br />
rescue:~# <strong>rm -rf /opt/home</strong><br />
rescue:~# <strong>umount /mnt</strong></code></p>
<p>Alright, xfs is GONE, everything is ext3 and has its old content back in it <img src='http://warmcat.com/_wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Let&#8217;s get our / filesystem mounted at /mnt now and update our fstab to record the demise of xfs</p>
<p><code>rescue:~# <strong>mount /dev/md1 /mnt</strong></code><br />
and edit <strong>/mnt</strong>/etc/fstab (notice the /mnt!) to reflect that we got rid of xfs on /usr and /home and replaced it with ext3 (from -> to again)</p>
<p><code>/dev/md5    /usr        xfs     defaults        0 2<br />
<strong>/dev/md5    /usr        ext3     defaults        0 2</strong></p>
<p>/dev/md6        /home           xfs    defaults,userquota        0 2<br />
<strong>/dev/md6        /home           ext3    defaults        0 2</strong><br />
</code></p>
<p>Alright, the filesystem messing is done.</p>
<h3>Goodbye lilo</h3>
<p>Next job is to expunge lilo and replace it with grub.</p>
<p><code>rescue:~# <strong>grub-install --no-floppy /dev/sda</strong><br />
rescue:~# <strong>grub-install --no-floppy /dev/sdb</strong></code></p>
<p>You need to change the bogus /boot/grub/grub.conf that 1&#038;1 mislead you with, into this (change the kernel and initrd version number to what you actually have from your f7 kernel in /mnt/boot ).</p>
<p><code>rescue:~# <strong>vi /mnt/boot/grub/grub.conf</strong><br />
serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1<br />
terminal --timeout=5 console serial<br />
default=0<br />
timeout=10</p>
<p>title Normal Fedora<br />
        root (hd0,0)<br />
        kernel /boot/vmlinuz-2.6.22.2-42.fc6 ro root=/dev/md1 console=ttyS0,57600 panic=30<br />
        initrd /boot/initrd-2.6.22.2-42.fc6.img</code></p>
<h3>Reboot into F7 with F7 kernel</h3>
<p>Finally we should umount and reboot into your new Fedora kernel</p>
<p><code>rescue:~# <strong>umount /mnt</strong><br />
rescue:~# <strong>umount /opt</strong><br />
rescue:~# <strong>reboot</strong></code></p>
<p>On reboot you should see a grub menu on the serial console which will timeout and boot you (all being well).</p>
<h3>Adding selinux</h3>
<p>The bogus FC4 install from 1&#038;1 did not include any selinux.  This is a pretty bad omission, and we can fix it now.  Edit /etc/sysconfig/selinux and set initially to be</p>
<p><code>SELINUX=permissive</code></p>
<p>Then</p>
<p><code># <strong>touch /.autorelabel</strong><br />
# <strong>reboot</strong></code></p>
<p>This will cause the initscripts to relabel all your filesystems according to your Fedora 7 policy.  It will reboot automatically after doing this, when it comes back up selinux will be working in a &#8220;firing blanks&#8221; mode.  It just reports any errors and lets the access occur anyway.  You can judge from this what will break when you enable it properly.  In my case there were three areas that were broken, first one user has ~/public_html, it needed to be enabled in selinux and then marked up as okay to serve by httpd</p>
<p><code># <strong>setsebool -P httpd_enable_homedirs 1</strong><br />
# <strong>chcon -R -t httpd_sys_content_t /home/user/public_html</strong></code></p>
<p>Second for some reason named couldn&#8217;t start because it wasn&#8217;t allowed to write its own pid in the chroot, I worked around it with this</p>
<p><code># <strong>setsebool -P named_write_master_zones on</strong></code></p>
<p>The third problem was gitweb, I am asking about it on the selinux mailing list and will update when I have a resolution.  UPDATE 2007-09-05: No response from the fedora-selinux ml, I resolved it myself as <a href="http://warmcat.com/_wp/?p=36">described here</a>.</p>
<p>When you are sure that any remaining avcs (you can find them in /var/log/messages) are trivial or there are no more being generated, you can properly turn selinux on by editing /etc/sysconfig/selinux again and this time setting</p>
<p><code>SELINUX=enforcing</code></p>
<p>and rebooting.</p>
<h3>Conclusion</h3>
<p>Hopefully I recorded everything that was needed to convert the craptasic bogus unsafe FC4 install in 1&#038;1 servers to clean and true Fedora 7.  Certainly being able to yum update kernels as usual is a major step forward, getting you 2.6.22 (in fact I installed a Fedora development repo kernel which is 2.6.23-rc5) from the original non-Fedora 2.6.16.  And it&#8217;s crazy to not have selinux when it&#8217;s provided by normal Fedora.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2007/09/05/forcing-11-to-make-f7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Fedora, Jim: but not as we know it</title>
		<link>http://warmcat.com/_wp/2007/07/30/its-fedora-jim-but-not-as-we-know-it/</link>
		<comments>http://warmcat.com/_wp/2007/07/30/its-fedora-jim-but-not-as-we-know-it/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 05:49:34 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=34</guid>
		<description><![CDATA[Pretty strange version of Fedora running on 1&#038;1 dedicated Linux servers.
First it is FC4, which is out of security update coverage, and Fedora Legacy has gone away too.  I update it to FC6 via yum (worried about the libata change in the F7 kernels making it unbootable&#8230; needn&#8217;t've worried since I can make it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/noodle-girl.png" align=left>Pretty strange version of Fedora running on 1&#038;1 dedicated Linux servers.</p>
<p>First it is FC4, which is out of security update coverage, and Fedora Legacy has gone away too.  I update it to FC6 via yum (worried about the libata change in the F7 kernels making it unbootable&#8230; needn&#8217;t've worried since I can make it unbootable all by myself).  After the update the /boot/grub/grub.conf looks a bit strange, grubby did not make an entry for the FC6 kernel so I add it by hand.</p>
<p>On reboot, it ignores the new kernel and boots the old one.  Further digging reveals that it is set up to use LILO, not grub.  They provide and cook their own 2.6.17 kernel which was built on a Debian box and does not use an initrd: it has all the drivers it needs built into the monolithic kernel.  Hm.</p>
<p><span id="more-34"></span></p>
<p>I google through pages from 1998 to learn about LILO, I make a mistake: I saw they had a symlink /boot/vmlinuz to point to the kernel they boot from, so I changed the symlink, reran lilo and rebooted&#8230; it doesn&#8217;t come back up.  Now 1&#038;1 have a cool serial console server concept, you can ssh into their central site with your per-server credentials and you are looking at your server&#8217;s serial console.  From this I see it can&#8217;t find the root filesystem.  Well no problem, I will choose one of the backup lilo.conf configurations at the prompt, right?  Nope, they all rely on the same vmlinuz symlink I changed.</p>
<p>So at this point after an hour or so of having the shiny new server, it is borked.  However 1&#038;1 offer a free network boot recovery feature you can select from the web page: I did this and came up in a Debian recovery boot presumably over PXE.  From there I could mount my root fs /dev/md1 on /mnt and undo my kernel symlink change, and so got back a working system.  Whatever else, that is a pretty robust setup, I could trash the thing into an unbootable state and recover it all by myself without any tech support or even having to wait.  Great!</p>
<p>However considering they advertise it as a &#8220;Fedora&#8221; system, aside from not being able to use Fedora kernels, the jarring strangeness continued.  There is no selinux set up.  This is pretty bad considering the support is everywhere in Fedora for it and it doesn&#8217;t cause any trouble nowadays.  Nor is it possible to enable selinux simply: because the partition-happy Debian admins that set it up decided to format some (not all) of the partitions as xfs.</p>
<p>There is no firewall enabled&#8230; all of your entrails like network MySQL access are hanging out for the world to see.  I installed system-config-securitylevel and had it set up a bare Fedora-style firewall on top of which I copied over my long, long (and growing) list of DROP netblocks.</p>
<p>Some evil and perverse web admin stuff was on by default, dozens of PHP apps, that involved redirecting your mailserver log to somewhere crazy on /usr.  This seems like an invitation for bad things to happen, so I tore them all out with yum remove.</p>
<p>After some hours all of the virtual hosts on Apache were back up except yahoeuvre, which was creating problems in the error logs and not working properly.  Since it has been deprecated for a long while due to Yahoo format changes, I didn&#8217;t bother fixing it and set it to redirect here instead.</p>
<p>However, I am left wondering&#8230; is it fair to call that&#8230; well, &#8220;heavily customized&#8221; Debian-Fedora hybrid OS &#8220;Fedora&#8221;?  The Fedora kernel does have an xfs module, but they don&#8217;t allow to format stuff xfs in Anaconda so it&#8217;s &#8220;not really supported&#8221;.  They provide great admin tools though, not the PHP garbage but the serial console server and the recovery netboot are fantastic remote server admin powers: really allowing you to get out of jail when you need to.  Maybe it will be possible to come up in the recovery console, copy out the contents of the xfs partitions somewhere and reformat them ext3 and gradually convert the thing to &#8220;proper Fedora&#8221;.</p>
<p>EDIT 2007-09-05: In fact I have now converted this 1&#038;1 server to &#8220;proper Fedora 7&#8243;, see <a href="http://warmcat.com/_wp/?p=35">this post for details</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2007/07/30/its-fedora-jim-but-not-as-we-know-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jamendobox</title>
		<link>http://warmcat.com/_wp/2007/06/08/jamendobox/</link>
		<comments>http://warmcat.com/_wp/2007/06/08/jamendobox/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 14:44:01 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=32</guid>
		<description><![CDATA[Well I already knew that Jamendo allowed you to download their catalogue in Ogg, but by itself it was just an interesting side-note.  (Jamendo being the primary site to get liberally licensed music, often biased towards francophone nymphs)
But to my surprise I tried Fedora 7 Rhythmbox a few minutes ago, expecting nothing much but [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" alt="icon" title="icon" src="http://warmcat.com/blobber.png" />Well I already knew that <a title="Jamendo" href="http://jamendo.com">Jamendo</a> allowed you to download their catalogue in Ogg, but by itself it was just an interesting side-note.  (Jamendo being the primary site to get liberally licensed music, often biased towards francophone nymphs)</p>
<p>But to my surprise I tried Fedora 7 Rhythmbox a few minutes ago, expecting nothing much but the pile of Gnomic crud that assaulted me last time I tried it.   Ah no, mashed up with Jamendo (but apparently not as planned Magnatune) Rhythmbox has become more than the sum of the parts and has crashed uninvited into iTunes territory.</p>
<p>It has become a native client app you can start up and listen to a big catalogue of liberally licensed music, not only without the expectation of having money sucked from your living veins but even with the expectation of being moved to voluntarily donate to the people sending you their hard work for free, when you especially appreciated what they offered.</p>
<p>And there on the menu bar is the legal, sanctioned, intentional &#8220;download album&#8221; button.  In the face of this must you go and give money to the lawyer loving corporate coke snorting beast-creatures for mainstream crud?  Or should you not set out to make a direct connection with the artists and show them your appreciation in a direct and personal way?</p>
<p>An extraordinary advance for standard Linux media players!</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2007/06/08/jamendobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix relaying for Dynamic clients</title>
		<link>http://warmcat.com/_wp/2006/08/09/postfix-relaying-for-dynamic-clients/</link>
		<comments>http://warmcat.com/_wp/2006/08/09/postfix-relaying-for-dynamic-clients/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 10:23:01 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=12</guid>
		<description><![CDATA[My in-laws have a Fedora box on residential ADSL in Spain.  They experienced trouble with the terra.es mailservers, so I installed Postfix for them and set Thunderbird to use this local Postfix to directly forward their mail to the destination.
This works well except for a correspondent in Australia, who is on bigpond.com.  They [...]]]></description>
			<content:encoded><![CDATA[<p>My in-laws have a Fedora box on residential ADSL in Spain.  They experienced trouble with the terra.es mailservers, so I installed Postfix for them and set Thunderbird to use this local Postfix to directly forward their mail to the destination.</p>
<p>This works well except for a correspondent in Australia, who is on bigpond.com.  They use a blackholing service which has blackholed the whole residential ADSL netblock for their ISP, on the basis a lot of spam is coming directly from compromised Windows boxes, meaning that the Postfix on their box doesn&#8217;t get anywhere talking to bigpond (and annoyingly bigpond rejects the mail with a 450 not a 550, delaying notification that there are problems).</p>
<p>I am in a similar position, I run my own MX at home where I work, so mail is sent directly to me, but I am unable to reliably send outgoing mail directly due to some blackhole lists including my whole netblock.  My solution is to run a Postfix instance on warmcat.com, which is not used for incoming mail and is firewalled off from everyone except my home IP address.  As a belt-and-braces, the Postfix on warmcat.com is configured to only relay from my IP address anyway.</p>
<p>So the obvious solution to the problem with the in-laws would be to also route their outgoing mail through warmcat.com, which pretty much everybody will talk to since it is sat in a server farm.  But the fly in the ointment is that they are on residential ADSL, their IP address is changing every boot.  I don&#8217;t want to add an authentication layer because I don&#8217;t want to disrupt their mail any further while I get it working and the pinhole in the Firewall method is working fine for me too.</p>
<p>The first move was to regularize their dynamic IP using dyndns.org and the perl client from there.  This gave me a reliable FQDN that always resolves to their machine.  Then the problem was simplified to &#8220;how can I get Postfix to accept a list of clients allowed to relay using FQDNs?  And to track changes where the DNS mapping is dynamic?&#8221;.  It seems that you can&#8217;t, it only accepts netblocks.</p>
<p>To solve this problem I created the following script which runs from a cronjob.  See inside the script for instructions.<span id="more-12"></span></p>
<pre>#!/bin/bash

# update-valid-postfix-clients
# 2006-08-09 - andy@warmcat.com - v1.0
#
# Allows FQDNs to specify trusted clients to Postifx, including detection of IP address
# change and firewall opening and closing

# list the FQDNs you are allowing to see you server here, separated by spaces
# the DNS for these can be dynamic
# the script will open and close your firewall as the IPs for these change
# the script will take care to notify postfix to allow and disallow these IPs as they change

TRUSTED_FQDNS="home.warmcat.com some.domain.dyndns.org"

# list the networks that are trusted here separated by spaces
# notice that netblocks are handled by specifying the active part only
# eg, 192.168.0.0/24  --> 192.168.0 in this table
# You must open your firewall for these netblocks manually, the script does not do it

TRUSTED_NETS="127"

# VERBOSE=0   No output except fatal errors
# VERBOSE=1   Output only when something changes
# VERBOSE=2   Output each time run, even if nothing changed

VERBOSE=1

#
# Installation instructions
#
#  1) copy this file to /usr/local/bin/update-valid-postfix-clients
#
#  2) edit the above vars to configure for your situation
#
#  3) edit /etc/postfix/main.cf, comment out any existing mynetworks= line and uncomment the following line
#      mynetworks = hash:/etc/postfix/network_table
#
#  4) Add this to /etc/crontab
#      # open firewall and allow good users in postfix
#      00,05,10,15,20,25,30,35,40,45,50,55 * * * * root /usr/local/bin/update-valid-postfix-clients

#----------------------------------------
# no user serviceable parts below

DIRTY=0

function allow {
IP=`host "$1" | cut -d' ' -f4`
if [ ! -z "$IP" ] ; then
if [ -z "`cat /etc/postfix/network_table | grep $IP`" ] ; then  # IP was not in force before
DIRTY=1
if [ $VERBOSE -gt 0 ] ; then echo "IP change $1 -> $IP" ; fi
OLDIP=`cat /etc/postfix/network_table | grep $1 | cut -d' ' -f1`
if [ ! -z $OLDIP ] ; then
if [ $VERBOSE -gt 0 ] ; then echo "Removing firewall setting for $1 -> $OLDIP" ; fi
iptables -D INPUT -p tcp -s "$OLDIP" --dport 25 -j ACCEPT
fi
fi
echo "$IP OK # $1" >>/etc/postfix/network_table-new

# note that we open the firewall always even if we are not marked as dirty for postfix
# this is so a local reboot will get the firewall fixed up even if the remote DNS is unchanged

if [ -z "`iptables -L INPUT -n | grep "dpt:25" | tr -s ' ' | cut -d' ' -f4 | grep "$IP"`" ] ; then
if [ $VERBOSE -gt 0 ] ; then echo "Opening port 25 for $1 -> $IP"; fi
iptables -I INPUT -p tcp -s "$IP" --dport 25 -j ACCEPT
else
if [ $VERBOSE -gt 1 ] ; then echo "(Port 25 for $1 -> $IP already open)" ; fi
fi
fi
}

# give us an empty network_table file if it doesn't exist to avoid harmless errors

if [ ! -e /etc/postfix/network_table ] ; then
if [ $VERBOSE -gt 0 ] ; then echo "Creating /etc/postfix/network_table" ; fi
touch /etc/postfix/network_table
fi

# regenerate list

for i in $TRUSTED_FQDNS ; do allow $i ; done
for i in $TRUSTED_NETS ; do echo "$i OK" >>/etc/postfix/network_table-new ; done

if [ $DIRTY = 1 ] ; then
if [ $VERBOSE -gt 0 ] ; then echo "reloading postfix due to changes" ; fi
rm /etc/postfix/network_table
mv /etc/postfix/network_table-new /etc/postfix/network_table
postmap /etc/postfix/network_table
service postfix reload
else
if [ $VERBOSE -gt 1 ] ; then echo "(No changes)" ; fi
rm /etc/postfix/network_table-new
fi</pre>
<p>The script runs in a 5-minute cronjob, and takes care to do nothing if the IP address situation has not changed for the allowed FQDNs.  If it does find a change, it removes the firewall pinhole to Postfix from that IP address, and creates a new pinhole for the new address.  It also regenerates the list of allowed clients that can relay in Postfix, hashes the list and does a Postfix reload.  The result is that just adding a FQDN to the script at the top will allow that FQDN access to the server no matter if it has a dynamic IP, but nobody else can even see the mailserver thanks to the firewall.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2006/08/09/postfix-relaying-for-dynamic-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware networking in Fedora</title>
		<link>http://warmcat.com/_wp/2006/07/27/vmware-networking-in-fedora/</link>
		<comments>http://warmcat.com/_wp/2006/07/27/vmware-networking-in-fedora/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 08:24:36 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=11</guid>
		<description><![CDATA[Hum the wonderful czech guy who provides
http://ftp.cvut.cz/vmware/
allows VMware to work fine on Fedora normally (I have an XP install that runs inside VMware to provide Protel).  But since I migrated the VM to this laptop, networking seems to be fixed on host-only.  I can ping the host from inside the VM but nothing [...]]]></description>
			<content:encoded><![CDATA[<p>Hum the wonderful czech guy who provides</p>
<p>http://ftp.cvut.cz/vmware/</p>
<p>allows VMware to work fine on Fedora normally (I have an XP install that runs inside VMware to provide Protel).  But since I migrated the VM to this laptop, networking seems to be fixed on host-only.  I can ping the host from inside the VM but nothing else, despite (or because of perhaps) I selected &#8220;bridged&#8221;.</p>
<p>Going to have a fiddle.</p>
<p>Edit:  Hm, looks like arp proxying is broken on the wlan0 interface.  Moving to a brdige on eth0 works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2006/07/27/vmware-networking-in-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cursed AMD64 box</title>
		<link>http://warmcat.com/_wp/2006/07/09/cursed-amd64-box/</link>
		<comments>http://warmcat.com/_wp/2006/07/09/cursed-amd64-box/#comments</comments>
		<pubDate>Sun, 09 Jul 2006 20:12:34 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Desktop Linux]]></category>

		<guid isPermaLink="false">http://warmcat.com/_wp/?p=4</guid>
		<description><![CDATA[AMD Athlon 64 x2 4400+ box has been working fine for about a year with a Western Digital 10KRPM SATA drive.  This is a DFI Lanparty motherboard and a 450W PSU IIRC.  The machine was up 24/7 for most of that year since it was acting as my mailserver amongst other things.
A few [...]]]></description>
			<content:encoded><![CDATA[<p>AMD Athlon 64 x2 4400+ box has been working fine for about a year with a Western Digital 10KRPM SATA drive.  This is a DFI Lanparty motherboard and a 450W PSU IIRC.  The machine was up 24/7 for most of that year since it was acting as my mailserver amongst other things.</p>
<p>A few weeks ago the drive started acting erratically, I would waken in the morning and find that the ext3 filesystem on there had been remounted read-only because filesystem corruption had been detected.  I was able to fsck the filesystem back into sanity and the drive would act fine for several days. Well these stories always end the same way, with a drive that won&#8217;t complete a boot, and that was the case for this idiot too.</p>
<p>The particular disease was that the area of the disc that contained the LVM structure &#8212; Fedora sends in LVM by default now &#8212; was spewing hard IO errors when touched.  Therefore it couldn&#8217;t get past trying to bring up the LVM on boot and simply dropped dead.  I documented the evasive actions I took on this <a href="http://www.redhat.com/archives/fedora-list/2006-June/msg03297.html">fedora-list mail</a> , basically I was able to recover the ext3 filesystem that was inside the LVM block on to a new SATA drive.  &#8220;LVM&#8221;&#8217;s physical footprint is basically an 0&#215;30000 byte header before the ext3 filesystem starts.<br />
I installed FC5 on the new drive and brought over most of the data from the copy of the ext3 filesystem from the damaged drive, and went on pretty much as normal, with brief interruptions while I fished something I had forgotten I needed from the old filesystem.  But then to my disbelief, after just a week, the new drive &#8212; the only drive in the machine &#8212; blew chunks in a similar way, hard IO errors one morning.  I came in my work room and heard it performing the click of death.<br />
I recovered from this rather grimly from backups, I did not fancy attempting a second recovery of 60GB of data from a second drive inside of a week.  I stared at the AMD box for a minute or two though&#8230; I could think of two likely causes, the most likely one being the power supply.  If it was having trouble with its 12VDC line, serious trouble, it might cause the drive to reset itself as if a poweron was happening repeatedly.  It&#8217;s not hard to imagine that a set of such resets at random intervals might eventually catch the drive out in its initialization phase and cause it to throw a fit ending it its head scratching the surface.  The other possible cause is a bit more uncertain, both boxes were running the new FC5 2.6.17 kernel which has had a lot of work going on with libata and the kernel code for SATA.  I wonder if that is repeatedly attempting drive resets as a last resort.<br />
Anyway it had caused enough trouble, I swore off it and migrated back to running from this Centrino Duo laptop, it is plenty fast enough for a main workstation.  One nice feature of vmware is that the XP I am running inside it has no idea that it has moved machine, there is no activation crap &#8212; although this is of course a genuine retail copy of XP, one of two I own.  I shall probably have cause to write about it another time but I have to have XP for <a href="http://altium.com">Protel</a>.  It runs on top of Fedora Core thanks to Vmware workstation.</p>
]]></content:encoded>
			<wfw:commentRss>http://warmcat.com/_wp/2006/07/09/cursed-amd64-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
