Menu

#248 Sometimes starts two processes and refuses to listen

2.10.3
open
nobody
None
3
2017-09-08
2017-03-13
James Baron
No

starting opendkim from ubuntu service manger not working. It doesn't seem to like the -p argument

To start with, the service startup is ignoring my explicit declaration in the conf file. It's looking for the default and then expressly pending that to the command line.

root@dev:/etc# tail -1 /etc/opendkim.conf
Socket inet:8891@localhost

root@dev:/etc# service opendkim start

root@dev:/etc# tail -f /var/log/mail.log
Mar 13 07:31:16 dev opendkim[17448]: OpenDKIM Filter v2.10.3 starting (args: -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock)

root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# service postfix stop
root@dev:/etc# opendkim
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

Then it just all goes to crap because after reading this ... nothing in your life will ever make sense again:

root@dev:/etc# ps aux|grep dkim
root 18614 0.0 0.1 14512 948 pts/2 S+ 07:49 0:00 grep --color=auto dkim
root@dev:/etc# /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
root@dev:/etc# telnet localhost 8991
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
root@dev:/etc# pkill opendkim
root@dev:/etc# ps aux|grep dkim
root 18630 0.0 0.1 14512 940 pts/2 S+ 07:50 0:00 grep --color=auto dkim
root@dev:/etc# service opendkim start
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# ps aux|grep dkim
opendkim 18680 0.0 0.2 115036 1164 ? Ss 07:50 0:00 /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
opendkim 18681 0.0 1.6 221684 8044 ? Sl 07:50 0:00 /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
root 18691 0.0 0.1 14512 976 pts/2 S+ 07:50 0:00 grep --color=auto dkim
root@dev:/etc# service opendkim stop
root@dev:/etc# ps aux|grep dkim
root 18728 0.0 0.1 14512 972 pts/2 S+ 07:51 0:00 grep --color=auto dkim
root@dev:/etc# /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# ps aux|grep dkim
opendkim 18730 0.0 0.7 115036 3712 ? Ss 07:51 0:00 /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
opendkim 18731 0.0 1.6 221684 8100 ? Sl 07:51 0:00 /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
root 18741 0.0 0.1 14512 944 pts/2 S+ 07:51 0:00 grep --color=auto dkim
root@dev:/etc# pkill opendkim
root@dev:/etc# /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8991@localhost
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# pkill opendkim
root@dev:/etc# /usr/sbin/opendkim -p inet:8991@localhost
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# ps aux|grep dkim
opendkim 18765 0.0 0.7 115036 3764 ? Ss 07:52 0:00 /usr/sbin/opendkim -p inet:8991@localhost
opendkim 18766 0.0 1.5 221684 7956 ? Sl 07:52 0:00 /usr/sbin/opendkim -p inet:8991@localhost
root 18780 0.0 0.1 14512 968 pts/2 S+ 07:52 0:00 grep --color=auto dkim
root@dev:/etc# pkill opendkim
root@dev:/etc# ps aux|grep dkim
root 18783 0.0 0.1 14512 936 pts/2 S+ 07:52 0:00 grep --color=auto dkim
root@dev:/etc# /usr/sbin/opendkim -p inet:8991@localhost
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root@dev:/etc# ps aux|grep dkim
opendkim 18789 0.0 0.7 115036 3768 ? Ss 07:53 0:00 /usr/sbin/opendkim -p inet:8991@localhost
opendkim 18790 0.0 1.5 221684 7960 ? Sl 07:53 0:00 /usr/sbin/opendkim -p inet:8991@localhost
root 18807 0.0 0.1 14512 972 pts/2 S+ 07:53 0:00 grep --color=auto dkim
root@dev:/etc# pkill opendkim
root@dev:/etc# ps aux|grep dkim
opendkim 18789 0.0 0.7 115036 3768 ? Ss 07:53 0:00 /usr/sbin/opendkim -p inet:8991@localhost
opendkim 18790 0.0 1.5 221684 7960 ? Sl 07:53 0:00 /usr/sbin/opendkim -p inet:8991@localhost
root 18810 0.0 0.2 14512 1012 pts/2 S+ 07:53 0:00 grep --color=auto dkim
root@dev:/etc# pkill opendkim
root@dev:/etc# ps aux|grep dkim
root 18813 0.0 0.2 14512 1032 pts/2 S+ 07:53 0:00 grep --color=auto dkim
root@dev:/etc# /usr/sbin/opendkim
root@dev:/etc# ps aux|grep dkim
opendkim 18820 0.0 0.7 115036 3588 ? Ss 07:54 0:00 /usr/sbin/opendkim
opendkim 18821 0.0 1.5 221684 7996 ? Sl 07:54 0:00 /usr/sbin/opendkim
root 18828 0.0 0.1 14512 932 pts/2 S+ 07:54 0:00 grep --color=auto dkim
root@dev:/etc# telnet localhost 8891
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet>

Discussion

  • James Baron

    James Baron - 2017-03-13

    Another thing I should mention, unix socks aren't working.
    It seems to open the sock and I can connect to it but postfix won't .. or something.

     
  • Serrano

    Serrano - 2017-09-08

    Also seeing this behaviour with 2.11.0~alpha-10 on Debian stretch. OpenDKIM seems to ignore configurations in /etc/opendkim.conf when started with service opendkim start. It creates a unix socket even though I specified an inet socket. When executing opendkim without any arguments, the socket is created successfully, as James showed.

     
  • Serrano

    Serrano - 2017-09-08

    See this bugreport for a (temporary) solution:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861169

     

Log in to post a comment.