Tag Archives: Linux

Another upgrade, another problem

Yep, it happened again … about this time last year I was trying to upgrade my servers to Fedora Core 6 and ran into some problems.

Well, I decided it was time to upgrade to Fedora 8 … and, since I have time off, I figured this was a fine time to do it again.

Bad move.

Of course, in retrospect … there never would have been a good time to do the upgrade, based on the problems I encountered. At least I know my backup procedure is fairly good now.

I had been planning this upgrade for weeks … everything was set. In fact, the first half of the upgrade went smooth as silk. I upgraded the main web server (gondor) to Fedora 8 and it went pretty nicely. Only two issues, both of which were solved after a little research.

This gave me the confidence to proceed to upgrade Rivendell to Fedora 8.

I started the upgrade by booting from the CD so I could install Fedora from the DVD ISO image I had on a USB hard drive. Problem is, the system wouldn’t boot this way.

Continue reading

SpamAssassin problem on Fedora 6

Yesterday I found that the RPM database on my Fedora Core 6 linux system’s were corrupted and that the regularly running update process was failing (without telling me, unfortunately).

After fixing the RPM database problem (rm -f /var/lib/rpm/__db.* && rpm -vv --rebuilddb) and running the update (yum update), I found that SpamAssassin’s update process wasn’t working anymore.

root@rivendell ~]# sa-update
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Scalar/Util.pm line 30.

Apparently one of the updates that were applied in the mass update caused SpamAssassin to break.

The same problem occurred when I tried to test the SpamAssassin rules.

root@rivendell ~]# spamassassin --lint
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Scalar/Util.pm line 30.

A bit of research turned up this link.

Luckily the fix was fairly easy … just update the Scalar-List-Utils CPAN package …

perl -MCPAN -e 'install "G/GB/GBARR/Scalar-List-Utils-1.18.tar.gz"

… and everything worked fine again.

Hard Drive Failures

Hard DriveI’ve noticed something … in recent memory, I have not suffered one single hard drive failure.

I’ve only suffered multiple hard drive failures … all my drive failures seem to happen in batches.

Last weekend the refurbished Seagate hard drive in my laptop (Rohan) started generating errors. About the same time, the main drive in Gondor started to flake out.

My laptop had been recently backed up with ghost, so getting it restored , to a spare 100gb hard drive I had, wasn’t a problem. I did struggle a bit because there was a Linux partition on the replacement drive … that Ghost didn’t know how to delete.

The drive in Gondor was a bit more problematical … although Linux was reporting problems with the drive, the Dell hard drive diagnostics reported problems with the drive, when I ran Spinrite over it, no problems were reported.

I decided to let the drive sit and see if the problems came back.

Obviously they did … this time, however, when I ran Spinrite on the drive it found a bad cluster. Luckily it was able to recover the cluster. After Spinrite was done, I copied the old drive to a new 300gb drive. Now I just have to get Dell to send me a new drive. Not sure what I’m going to do with a spare 80gb SATA drive.

Of course, all these hard drive problems got me to thinking … why the heck don’t operating systems raise serious alerts when a drive failure is detected?

On Windows XP, the drive problem was silently being logged to the “System Event Log”. I think it should have popped up a warning message telling me that something was wrong.

On Linux, the drive problems were also being logged to syslog … but if you aren’t actively monitoring the systems logs, it’s easy to miss something like that. I’m going to investigate some system monitoring software (something like Nagios) to keep an eye on problems of this nature.

Clean up /tmp

Recently I noticed that there’s a lot of temporary files in the /tmp directory on my mail server … all the files have spamassassin in the file name. I figured that in some cases, SpamAssassin (or programs it calls) isn’t cleaning up properly.

I whipped up this script that will clean up any spamassassin files & directories that are older than a set number of minutes (60 in my case)…

#!/bin/sh

AGE=60

if [ "$1" == "--test" ]
then
        CMD="-exec echo"
        echo "$0: test mode"
else
        CMD="-exec"
fi

/usr/bin/find /tmp \
        -mmin +$AGE \
        -name spamassassin.ocr* \
        $CMD /bin/rm -f '{}' \;

/usr/bin/find /tmp \
        -maxdepth 1 \
        -mmin +$AGE \
        -type d \
        -name .spamassassin\* \
        $CMD /bin/rm -rf '{}' \;

If you run the script with a parameter of ‘–test’, it will just show the commands it would have executed.

I put the script in /etc/cron.hourly directory so it gets executed every hour.