opendkim does not start properly when ldap server can't be contacted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
opendkim (Ubuntu) |
Fix Released
|
Medium
|
Scott Kitterman |
Bug Description
when starting opendkim, if ldap is in use and the server cannot be contacted, opendkim gets stuck in a state where the system appears to think it has started, but is not actually running:
>systemctl -l status opendkim
● opendkim.service - LSB: Start the OpenDKIM service
Loaded: loaded (/etc/init.
Active: active (exited) since Wed 2015-05-06 23:16:20 EDT; 1min 24s ago
Docs: man:systemd-
Process: 589 ExecStart=
May 06 23:16:19 server systemd[1]: Starting LSB: Start the OpenDKIM service...
May 06 23:16:20 server opendkim[589]: Starting OpenDKIM: opendkim: /etc/opendkim/
May 06 23:16:20 server opendkim[589]: opendkim.
May 06 23:16:20 server systemd[1]: Started LSB: Start the OpenDKIM service.
>ps -aefwww | grep -iF dkim
root 858 815 0 23:18 pts/0 00:00:00 grep -iF dkim
additional attempts to start opendkim don't indicate failure, but also don't work:
>systemctl start opendkim
>
>ps -aefwww | grep -iF dkim
root 863 815 0 23:19 pts/0 00:00:00 grep -iF dkim
additionally, as can be seen in the above systemctl status output, systemd appears to think that opendkim has started successfully, but when testing manually, it does not:
>/usr/sbin/opendkim -x /etc/opendkim/
opendkim: /etc/opendkim/
>echo $?
78
lastly, stopping opendkim [even though it's not really running] and then starting it again then results in it actually running:
>systemctl stop opendkim
>systemctl start opendkim
>ps -aefwww | grep -iF opendkim
opendkim 1105 1 0 23:24 ? 00:00:00 /usr/sbin/opendkim -x /etc/opendkim/
opendkim 1106 1105 0 23:24 ? 00:00:00 /usr/sbin/opendkim -x /etc/opendkim/
root 1117 815 0 23:25 pts/0 00:00:00 grep -iF opendkim
I can't replicate this on an older release with upstart instead of systemd.
service opendkim start 192.0.2. 1/ou=people, dc=example, dc=com? DKIMSelector? sub?(DKIMIdenti ty=$d): dkimf_db_open(): Can't contact LDAP server
Starting OpenDKIM: opendkim: /etc/opendkim.conf: ldap://
opendkim.
# ps -AF|grep opendkim
opendkim 677 1 0 63960 1648 0 Apr30 ? 00:00:01 rsyslogd
root 3012 12880 0 2216 648 1 00:11 pts/4 00:00:00 grep opendkim
# service opendkim status
* opendkim is not running
I suspect this is a systemd issue.
As a workaround, you might add SoftStart true to your opendkim.conf. That should cause it to start normally without LDAP.