The problem turned out to be a missing folder for the opendkim process that was specified in /etc/opendkim.conf
:
PidFile /var/run/opendkim/opendkim.pid
I found this out by typing systemctl status opendkim.service
after it failed to start.
Output:
● opendkim.service - LSB: Start and stop OpenDKIM
Loaded: loaded (/etc/rc.d/init.d/opendkim)
Active: failed (Result: timeout) since Sat 2016-05-28 20:16:56 CDT; 1min 40s ago
Docs: man:systemd-sysv-generator(8)
Process: 2640 ExecStart=/etc/rc.d/init.d/opendkim start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/opendkim.service
├─2643 /usr/local/sbin/opendkim -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid
└─2645 /usr/local/sbin/opendkim -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid
May 28 20:11:56 alpha systemd[1]: Starting LSB: Start and stop OpenDKIM...
May 28 20:11:56 alpha opendkim[2640]: Starting OpenDKIM Milter: [ OK ]
May 28 20:11:56 alpha systemd[1]: PID file /var/run/opendkim/opendkim.pid not readable (yet?) after start.
May 28 20:11:56 alpha opendkim[2643]: can't write pid to /var/run/opendkim/opendkim.pid: No such file or directory
May 28 20:11:56 alpha opendkim[2645]: OpenDKIM Filter v2.4.2 starting (args: -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid)
May 28 20:16:56 alpha systemd[1]: opendkim.service start operation timed out. Terminating.
May 28 20:16:56 alpha systemd[1]: Failed to start LSB: Start and stop OpenDKIM.
May 28 20:16:56 alpha systemd[1]: Unit opendkim.service entered failed state.
May 28 20:16:56 alpha systemd[1]: opendkim.service failed.
To fix this, I first stopped the opendkim process:
systemctl stop opendkim
Then I created a service that would make the dir at start:
vim /etc/systemd/system/georges.service
The contents of /etc/systemd/system/georges.service
:
[Unit]
Description=George's Simple Service
After=network.target
[Service]
Type=simple
ExecStartPre=-/usr/bin/mkdir /var/run/opendkim
ExecStart=/usr/bin/chown opendkim:opendkim /var/run/opendkim
Restart=on-abort
[Install]
WantedBy=multi-user.target
Then I started this service:
systemctl start georges
systemctl status georges
Output:
[root@alpha etc]# systemctl status georges.service
● georges.service - George's Simple Service
Loaded: loaded (/etc/systemd/system/georges.service; disabled; vendor preset: disabled)
Active: inactive (dead)
May 28 20:53:50 alpha systemd[1]: Starting George's Simple Service...
May 28 20:53:50 alpha systemd[1]: Started George's Simple Service.
Lastly I told the system to load it on startup:
systemctl enable georges
Not that I understand everything I did, but hey--it works for me! Feel free to let me know if I've wrecked anything by doing this...
UPDATE
I asked a question about this and they pointed out the correct way to have the system create a run directory:
Create this file:
/etc/tmpfiles.d/opendkim.conf
Drop in this one line (ok 2 if you count the comment):
#Type Path Mode UID GID Age Argument
d /run/opendkim 0755 opendkim opendkim - -
Boom--it works just as well at reboot but doesn't require a new service to be configured.