Dovecot dead but subsys locked error

When you restart dovecot, if it won’t start up again it’s likely the process crashed on startup but left the subsys lockfile in place. This prevents dovecot from starting up again.

If you run

/etc/init.d/dovecot status

and you see an error mesage like this, then you know the process has crashed and not cleaned up properly:

dovecot dead but subsys locked

Check the /var/log/maillog file (the exact mail log file may vary from Linux/BSD distro to distro) and you’ll see something like this:

Oct 24 14:21:57 vps131 dovecot: Killed with signal 15
Oct 24 14:21:57 vps131 dovecot: Dovecot v1.0.rc15 starting up
Oct 24 14:21:58 vps131 dovecot: auth(default): mysql: Unknown connect string: pass
Oct 24 14:21:58 vps131 dovecot: Auth process died too early - shutting down
Oct 24 14:21:58 vps131 dovecot: child 7766 (auth) returned error 89
Oct 24 14:21:58 vps131 dovecot: Temporary failure in creating login processes, slowing down for now

In this instance there was a configuration error and dovecot crashed. It’s a shame it doesn’t die more gracefully.

The solution is simple. Check /var/lock/subsys and you’ll see the dovecot file there. It’s simply a matter of doing this:

rm /var/lock/subsys/dovecot

and then starting dovecot again. Obviously you’ll need to work out what the configuration error was and fix it first.