September 17, 2005

Postfix & Tiger upgrade

I've finally made the upgrade to Tiger on my mail server. That is, I've finally 'successfully' upgraded, it took a few attempts to get everything just right for what I wanted, and now that I'm done I thought I'd share a few details.

Probably the most important step is to make sure that you have a good backup before starting. For me, this step was critical, as it allowed me to back out at any time and get running again from the backup. I wasn't just upgrading from 10.3 to 10.4, but was also upgrading Postfix, MySQL, and PCRE all at the same time...

Tiger (10.4) includes version 2.1.5 of Postfix, for most folks this is probably more than sufficient. However, I wanted to upgrade to the Postfix 2.2.5 release, as it includes a few more bells & whistles that I wanted, I wanted to bring MySQL current, and also bring PCRE (Perl Compatible Regular Expressions) up to date. Basically, this meant upgrading my system to Tiger, upgrading/compiling each new piece, and finally getting it all up and running.

MySQL was a snap, thanks to a ready made Installer built for Tiger. I was upgrading from an earlier 4.1.x release, so there were no worries about my databases not working correctly, and it was a simple matter of copying over the data directory from the old path to the new and getting MySQL running.

PCRE compiled well, but prior to compiling I also upgraded to the latest version of Xcode to get all the latest libraries installed. Standard docs on how to install worked just fine.

The last and trickiest step was getting Postfix compiled properly. After trying a few times and having problems, I finally took a step back and found my error, a simple typo caused from a copy/paste error when trying to get both the MySQL and PCRE code compiled in. For reference, here's the correct MAKE instruction for that:

make -f Makefile.init makefiles \
    'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DHAS_PCRE -I/usr/local/include' \
    'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/lib -lpcre'

After that, it was just a matter of running Make, and then Make Upgrade.

The last and trickiest step was to get Postfix running at Startup again. The Tiger upgrade removed my Postfix StartupItem (included with the Postfix source code), so that just needed copied back to /Library/StartupItems, and I also removed the /System/Library/LaunchDaemons/org.postfix.master.plist file that Tiger includes for starting Postfix on demand, as I wanted this running all the time, and it also didn't seem to be launching my newly compiled version of Postfix properly. I also needed to edit the /etc/hostconfig file to change MAILSERVER=-NO- to -YES-, and after that Postfix launched perfectly.

In hindsight, I probably should have upgraded 10.4 to 10.4.2 before upgrading everything else, but no mail related updates seem to be part of the upgrade, so this shouldn't be a problem. But if you're planning on going to 10.4 and recompiling other software, get your OS fully current first, then start in on your other work, it'll save you the trouble later.

I used Mike Bombich's excellent Carbon Copy Cloner to clone my working system to a backup drive, upgrade that and was able to do all my testing on a backup drive prior to the actual upgrade, and at any time I could simply reboot from my primary drive and be up and running. Very useful when you can't have a production system down long but need to do some 'live' testing.

Posted by Jim at September 17, 2005 10:55 PM | TrackBack