Re: "opendkim dead but subsys locked" yet there are opendkim processes

From: Murray S. Kucherawy <msk_at_blackops.org>
Date: Thu, 17 Jan 2013 06:32:45 -0800 (PST)

On Thu, 17 Jan 2013, Tracy Wise wrote:
> So then I did "pkill opendkim" and also "rm /var/lock/subsys", and then
> rebooted again.
>
> Well same thing after rebooting.  "service opendkim status" says "opendkim
> dead but subsys locked", and yet there are two opendkim processes listed in
> the output of "ps -e".
>
> Anybody know why it's doing that?

Three things:

1) When opendkim starts, it tries to bind to port 8891 on the localhost
interface where it will receive connections from postfix as messages
arrive. This fails because something else is already operating on that
port. opendkim.conf's "Socket" line controls this, so you need to move
opendkim to some other port that's not in use, and reconfigure postfix to
match, or you need to figure out what other process is using that port and
move it to another port or stop it altogether. Two things cannot be bound
to the same port simultaneously.

2) It is configured to automatically restart, evidently without bound.
This is opendkim.conf's "AutoRestart" line. Evidently that is set to
"True" but no "AutoRestartRate" is also set, which governs how many times
or at what rate auto-restart will be attempted before opendkim figures
something is seriously wrong and gives up. I suggest reading the
opendkim.conf man page about "AutoRestartRate" and selecting an
appropriate limit. Regardless, there will be one parent opendkim process
whose pid is not changing; killing that should fix the restart loop, as
it's the one constantly starting new subprocesses.

3) You say you did "rm /var/lock/subsys", but that's a directory so "rm"
alone will cause an error. Try removing /var/lock/subsys/opendkim
instead. The error you're seeing comes from the fact that
/etc/init.d/opendkim (the start/stop script) attempts using either "pgrep"
or "pidof" to determine whether opendkim is running. It determines that
it is not because the process found in opendkim's pid file can't be found
using those methods, yet /var/lock/subsys/opendkim exists which is
supposed to be an indication that it is running. This is a side effect of
the tight restart loop you're experiencing.

-MSK
Received on Thu Jan 17 2013 - 14:33:05 PST

This archive was generated by hypermail 2.3.0 : Thu Jan 17 2013 - 14:36:01 PST