Junior developer

puts "Hello world!"

My Photo


I've been Twittering

The U.S. Navy reading list

Tom Copeland's Recent Posts

  • Things to keep from RubyForge
  • Generating Parsers with JavaCC, Second Edition now available
  • Transferring gem namespaces on RubyForge
  • Upgrading PostgreSQL with pg_migrator
  • The rubyforge gem and the RubyForge REST API
  • Applying the Rails XSS vulnerability patch
  • What gem namespaces does that RubyForge project own?
  • How much disk space is my RubyForge project using?
  • Refactoring RubyForge svn+http directives
  • Monit, Mongrel, and /usr/local/bin

RSS Feeds

All/ Java/ Ruby/ PostgreSQL/ General

Dovecot: Auth process died too early - shutting down

I upgraded a MySQL installation today and broke the dovecot POP/IMAP daemon. Fortunately, the fix wasn't too hard, and hopefully this will be useful to someone.

The MySQL upgrade was from 4.1 to 5.1, so it was a pretty big move. I compiled the new release, shut down the web server, dumped all the databases, removed the RPMs, installed the new version, restarted things and restored the databases. Things were pretty much working... although I had had to uninstall the old RPMs with rpm -e --nodeps since the dovecot POP3 daemon had MySQL as a dependency. But running ldd on /usr/sbin/dovecot showed no dependency on the MySQL client library, so I figured maybe that was just a spec file thing. Wrong!

I restarted dovecot and the process died leaving this in the log:

Jun 29 17:01:04 fiddle dovecot: Dovecot starting up
Jun 29 17:01:05 fiddle dovecot: Auth process died too early - shutting down
Jun 29 17:01:05 fiddle dovecot: child 6206 (auth) returned error 127

Not good. One of the dovecot options is to get passwords from a database. I use PAM, but dovecot still depended on MySQL. Blah!

Fortunately, the fix was pretty easy. I hunted down the source RPM, installed it with rpm -i dovecot-0.99.11-4.EL4.src.rpm, and edited /usr/src/redhat/SPECS/dovecot.spec. Here are the changes I made:

$ diff dovecot.spec.orig dovecot.spec
25,26d24
< BuildRequires: mysql-devel
< BuildRequires: postgresql-devel
68,69c66,67
< 	--with-pgsql                 \
< 	--with-mysql                 \
---
> 	--without-pgsql                 \
> 	--without-mysql                 \

7/30/09 update: Better yet, just set these options:

%define build_postgres 0
%define build_mysql 0

Then a quick build and install:

rpmbuild --ba /usr/src/redhat/SPECS/dovecot.spec
rpm -e dovecot
rpm -i /usr/src/redhat/RPMS/i386/dovecot-0.99.11-4.EL4.i386.rpm

And edit /etc/dovecot.conf:

$ diff /etc/dovecot.conf.rpm.orig /etc/dovecot.conf
14a15
> protocols = imap imaps pop3 pop3s
197a199
> default_mail_env = mbox:/var/spool/mail/%u

Enable dovecot to start on boot with /sbin/chkconfig --level 345 dovecot on and you're back in business. Hope this helps someone!

Incidentally, if you need a Postfix book, try The Book of Postfix: State-of-the-Art Message Transport by Ralf Hildebrandt and Patrick Koetter. It's a few years old but still very relevant... and of course Postfix is a great mail server. Enjoy!

June 29, 2009 in General | Permalink | Comments (0) | TrackBack (0)

Compiling Subversion with a custom APR installation

I recently had to upgrade Subversion on an RHEL 4 machine; Subversion 1.1.4 was installed and that's getting a little long in the tooth. So I downloaded and tried to compile Subversion, but ran into problems because the RHEL 4 version of APR is pretty old too. Specifically, I got this error:

checking APR version... 0.9.4
wanted regexes are 0\.9\.[7-9] 0\.9\.1[0-9] 1\.
configure: error: invalid apr version found

So I poked around for a bit and figured out how the --with-apr and --with-apr-util options work. This works out well, actually, since I've got an upgraded version of Apache and now I can point Subversion to it. For posterity, here's the invocation:

./configure  \
  --with-ssl \
  --enable-shared \
  --without-berkeley-db \
  --with-apxs=/usr/local/apache2/bin/apxs \ 
  --with-apr=/usr/local/apache2/bin/apr-1-config \
  --with-apr-util=/usr/local/apache2/bin/apu-1-config

Hope this helps someone!

February 04, 2009 in General | Permalink | Comments (1) | TrackBack (0)

Latest Coast Guard videos

Here's the latest Coast Guard videos from thenewsroom - CGA 94, w00t!

May 10, 2007 in General | Permalink | Comments (0) | TrackBack (0)

Nicer Bugzilla URLs

If you've got Bugzilla running in your company you know what the URLs for a bug look like: http://mybugzilla.com/show_bug.cgi?id=123.  That's fine, but it's a bit of a pain to type into an email or an indi comment.   It'd be nicer to be able to just put http://mybugzilla.com/123 and get to the right bug.  This is easy with a little mod_rewrite rule; just put this in your Bugzilla's virtual host definition:

  RewriteEngine On
  RewriteRule ^/([0-9]+)$ /show_bug.cgi?id=$1 [PT]

This rule rewrites any request that consists of one of more digits as a "passthru" to the default bug display URL.  We could probably use a RedirectMatch instead, but, hey.

Thanks to Rich Bowen for his excellent mod_rewrite book; it's been extremely helpful for making little improvements like this. Good stuff! 

February 06, 2007 in General | Permalink | Comments (0) | TrackBack (1)

ejabberd, Erlang, and Fedora Core 5

If you're compiling Erlang R10B-10 on Fedora Core 5, you may hit this error:

:hipe/hipe_x86_signal.c:192: undefined reference to `__next_sigaction'
:hipe/hipe_x86_signal.c:182: undefined reference to `INIT'
:hipe/hipe_x86_signal.c:192: undefined reference to `__next_sigaction'
collect2: ld returned 1 exit status
make[3]: *** [/usr/local/src/otp_src_R10B-10/bin/i686-pc-linux-gnu/beam.hybrid] Error 1
make[3]: Leaving directory `/usr/local/src/otp_src_R10B-10/erts/emulator'
make[2]: *** [hybrid] Error 2
make[2]: Leaving directory `/usr/local/src/otp_src_R10B-10/erts/emulator'
make[1]: *** [hybrid] Error 2
make[1]: Leaving directory `/usr/local/src/otp_src_R10B-10/erts'
make: *** [emulator] Error 2

To fix it, there's a small patch by Mikael Pettersson to add the GLIBC version number; it just changes this line in erts/emulator/hipe/hipe_x86_signal.c from this:

#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 3

to this:

#if __GLIBC__ == 2 && (__GLIBC_MINOR__ == 3 || __GLIBC_MINOR__ == 4)

Once that's done it's off to the races.  It's a hefty make process, though; took 13 minutes on my dual core/4 GB machine.

April 05, 2006 in General | Permalink | Comments (0) | TrackBack (0)