Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

System Admins

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

« How to flash your bios with an Asus P5E MB and NO floppy diskStats For The Last Three Months »
comments

CentOS, Postfix, MySQL and a Typo

by damber on Sep 05, 2008 in categories Linux, RHEL
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

A little lesson in typo-trauma

Today I finally got round to doing some admin on my primary home server, which (amongst many things) is my main mail server. After dusting a few cobwebs away, checking nobody had broken any of the furniture and such, I decided to run yum to get the latest updates (it had been almost a month since the last time I checked 88| but still, at least now it was about to be updated to all the shiny sparkly new things that CentOS had released for me…

And it did, it came up with about 5 or 6 updates, including an update to postfix. Great. So, it finished in about a minute or two and I went on about my evening. All was happy in the land of the ignorant.

Ignorant, that is, until I decided to send an email to my dear old mum to give her an update on the list of laptops I was recommending for her (I know, I’m so thoughtful :D). At which point my squirrelmail (webmail) froze.. you see, I’m currently re-decorating my study, so have moved my main workstation into another room, and as such it’s not in use.. and my other non-work laptop is, er, recovering from, er, how do you say it? A little ‘rinse’ in the bath… so, work laptop it is, and webmail access only…

I thought maybe it was my damn windows wifi connection at first because it has been such a problem the last few days.. (I can’t wait to get back to my linux environments, this windows only stuff is giving me a serious heart condition.) Anyway, after a prod and a poke it seemed that it might be the mail server…

Determining the problem

So, I checked the mail server logs and discovered…

  1. [root@phantom ~]# tail /var/log/maillog
  2. phantom postfix/smtpd[8736]: fatal: unsupported dictionary type: mysql

mmmm… now, that looks familiar.. wasn’t that a problem I faced when setting up this mail server? The problem that centos repositories only provide the standard postfix rpm which doesn’t have mysql support compiled in? But, it has been working for ages.. why is it failing now ? Hold on.. let me check what exactly was updated again recently…

  1. [root@phantom ~]# tail /var/log/yum.log
  2. Updated: postfix - 2:2.3.3-2.1.el5_2.i386

Ahhhh… bugger.:'(

Path of enlightenment

OK… now I’m thinking that some stupid numpty has released the wrong rpm in the wrong repository, because I know that I set things up originally to exclude the main repositories for postfix updates and only get it from the centosplus repository. Of course I did. I’m sure. I think. mmmmm… ok, let me check…

  1. [root@phantom ~]# vi /etc/yum.repos.d/CentOS-Base.repo
  2. #released updates
  3. [updates]
  4. name=CentOS-$releasever - Updates
  5. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  6. #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  7. gpgcheck=1
  8. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  9. priority=1
  10. exclude=kernel* posfix*   <<<<<<——looky at what we have here..
  11. [centosplus]
  12. name=CentOS-$releasever - Plus
  13. mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;arch=$basearch&amp;repo=centosplus
  14. #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
  15. gpgcheck=1
  16. enabled=1
  17. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  18. priority=2
  19. includepkgs=kernel* postfix*

Ooops. Can you spot it? :yes: Yep, exactly - every entry apart from the updates was excluding “postfix", whilst the updates were excluding “posfix".. :no:

Fixing the shame..

That, my friend, is the scourge of bugs everywhere.. the humble typo. ah well. Lesson learnt.. now just to download the previous centosplus package for postfix with mysql built in and re-install it (and fix that damn typo):

  1. [root@phantom ~]# wget http://www.mirrorservice.org/sites/mirror.centos.org/5.2/centosplus/i386/RPMS/postfix-2.3.3-2.el5.centos.mysql_pgsql.i386.rpm
  2. [root@phantom ~]# rpm -Uvh —-replacepkgs —-force postfix-2.3.3-2.el5.centos.mysql_pgsql.i386.rpm
  3. [root@phantom ~]# sed -i ’s/posfix/postfix/g’ /etc/yum.repos.d/CentOS-Base.repo

phew… mail server back up and working again. I thought for a brief second that it was going to be a major problem, but, thankfully, a download + install to rollback and a correction of a typo later.. and I’m back up and running :-) A lesson in scrutiny of important configuration data has been learnt..:lalala: until the next time.. ;D

7371 views
submit to reddit Digg!FacebookDotnetkicks

Comments and Feedback

7 comments

Comment from: chrissie1 [Member] Email
I hope you didn't miss any important spam.
06/09/08 @ 01:03
Comment from: damber [Member] Email

I don't think so - did you send me anything? ;-)
06/09/08 @ 02:52
Comment from: Steve [Visitor] Email
I think i did something similar. If you don't have the exclude or include package stuff, will an updates package still install on top of a package installed from the centosplus repos? Also, isn't the plus repos always ahead in version numbers than the updates one? Did updates go as high as centosplus and that's why my mysql support stopped working?
07/09/08 @ 12:05
Comment from: damber [Member] Email
@Steve,

The include/exclude pkgs tells yum not to look for updates with the pattern specified, so you can basically only get updates from your preferred repo(s). When it updates, I believe it looks for the latest version across all repos that you allow to look for that pattern.

As for versions, it updated to 2.3.3-2.1 from 2.3.3-2 , so it thought it was getting the latest version - unfortunately the standard centos version doesn't come with mysql support compiled in, so you either have to go to the centosplus repo or build from source and set the flags etc. So, in this instance Updates repo had a higher version than the centosplus (which I believe takes a bit longer to come out as the base version would need recompiling with mysql support).

It would be great if centos would just compile in mysql support in the standard package.. it would save a lot of hassle for people - especially when you first install postfix.

07/09/08 @ 12:57
Comment from: Asai [Visitor]
This really saved my butt. Thanks for putting this up. I was starting to sweat when I updated Postfix and found that IT STOPPED WORKING with MYSQL! Then I found your post, thank God, and calmed down, and got it working again.
24/09/08 @ 22:04
Comment from: damber [Member] Email

Glad to hear it helped Asai - I doubt we are alone in this type of problem, it's easy to mistype or forget which package variant or dependencies are installed :-)
25/09/08 @ 14:34
Comment from: Dunxd [Visitor] · http://www.dunxd.com/
Just did exactly this myself. Thanks to your post, my postfix was fixed after a few fearful minutes!
05/04/10 @ 16:32

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)