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

From: Tracy Wise <>
Date: Thu, 17 Jan 2013 15:32:21 +0000

Regarding the "rm /var/lock/subsys", I'm sorry that's a typo, I did indeed do "rm /var/lock/subsys/opendkim".

Regarding the AutoRestartRate, actually it is indeed set in opendkim.conf. It's set for "10/1h" (ten times per hour).

But anyway I guess the real problem is related to my original problem, which is that opendkim can't bind to the port that was specified in some cookbook instructions that I followed, because the port is already in use by another process. Okay so I guess I have the liberty to change the port. But, out of curiosity I wanted to see what process is already using that port, and it appears that it's actually opendkim. Well, I mean when I do "sudo netstat -nlp" I find this within the output:
tcp 0 0* LISTEN 1695/opendkim
So, from my very limited knowledge, it appears that opendkim did indeed bind to that port, not another process. Or am I wrong on that?

> Date: Thu, 17 Jan 2013 06:32:45 -0800
> From:
> To:
> CC:
> Subject: Re: "opendkim dead but subsys locked" yet there are opendkim processes
> 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 - 15:32:34 PST

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