In short: I can’t get opendkim to start.
I want to use opendkim with Postfix.
When I try to start opendkim …
$ sudo systemctl start opendkim
… I don’t go back to the command line (until I decide to hit CTRL-C), it is like the program isn’t going into the background.
$ sudo systemctl status opendkim
× opendkim.service – DomainKeys Identified Mail (DKIM) Milter
Loaded: loaded (/usr/lib/systemd/system/opendkim.service; enabled; preset: disabled)
Active: failed (Result: timeout) since Mon 2024-06-10 13:55:45 UTC; 13min ago
Duration: 740us
Docs: man:opendkim(8)
man:opendkim.conf(5)
man:opendkim-genkey(8)
man:opendkim-genzone(8)
man:opendkim-testadsp(8)
man:opendkim-testkey
http://www.opendkim.org/docs.html
Process: 2244047 ExecStart=/usr/local/sbin/opendkim -p inet:12301@localhost (code=exited, status=0/SUCCESS)
CPU: 4ms
Jun 10 13:54:15 ip-172-31-9-176.us-east-2.compute.internal systemd[1]: Starting opendkim.service – DomainKeys Identified Mail (DKIM) Milter…
Jun 10 13:54:15 ip-172-31-9-176.us-east-2.compute.internal systemd[1]: opendkim.service: Can’t open PID file /run/opendkim/opendkim.pid (yet?) after start: No such file or directory
Jun 10 13:55:45 ip-172-31-9-176.us-east-2.compute.internal systemd[1]: opendkim.service: start operation timed out. Terminating.
Jun 10 13:55:45 ip-172-31-9-176.us-east-2.compute.internal systemd[1]: opendkim.service: Failed with result ‘timeout’.
Jun 10 13:55:45 ip-172-31-9-176.us-east-2.compute.internal systemd[1]: Failed to start opendkim.service – DomainKeys Identified Mail (DKIM) Milter.
[ec2-user@ip-172-31-9-176 ~]$
- I’m on AWS with Amazon Linux 2023.
- I downloaded opendkim-2.10.3, ran ‘configure’, ‘make’, ‘make install’.
- I do have an ‘opendkim’ user/group, which does have full permission to /run/opendkim (owned by opendkim.opendkim)
I eventually gave that folder 777 permissions,although that didn’t help( Also, I realize it won’t would stay that way)
Any help would be greatly appreciated.
Thanks.
- Brian Jacobs
Below is the contents of /usr/lib/systemd/system/opendkim.service
# If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers.
# For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to:
# After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service
[Unit]
Description=DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
After=network.target nss-lookup.target syslog.target
[Service]
Type=forking
PIDFile=/run/opendkim/opendkim.pid
#PIDFile=/var/run/opendkim/opendkim.pid
EnvironmentFile=/etc/sysconfig/opendkim
ExecStart=/usr/local/sbin/opendkim -p inet:12301@localhost
#ExecStart=/usr/local/sbin/opendkim $OPTIONS -x /etc/opendkim.conf
ExecReload=/bin/kill -USR1 $MAINPID
User=opendkim
Group=opendkim
[Install]
WantedBy=multi-user.target
Below is the contents of /etc/opendkim.conf
AutoRestart Yes
AutoRestartRate 10/1h
UMask 002
Syslog yes
SyslogSuccess Yes
LogWhy Yes
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
Mode sv
PidFile /run/opendkim/opendkim.pid
SignatureAlgorithm rsa-sha256
UserID opendkim:opendkim
Socket inet:12301@localhost
Below is the contents of /etc/sysconfig/opendkim (I think this is being used)
SOCKET="inet:12301@localhost"
Below is the contents of /etc/default/opendkim ( I don’t think this is being used)
SOCKET="inet:12301@localhost"
Brian Jacobs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.