Dear Maintainer,
In the good-old-days, spf-milter-python was started by /etc/init.d/spf-milter-python which ensured that the /var/run/spf-milter-python directory existed. Post-systemd, even calls to /etc/init.d/spf-milter-python directly are intercepted by /lib/lsb/init-functions and the systemd unit file doesn't create the directory automatically. Also, the directory is no longer persistent across reboots.
Currently the default /lib/systemd/system/spf-milter-python contains:
[Unit]
Description=SPF Milter Python
Documentation=man:spfmilter(1)
After=network.target
[Service]
Type=simple
PIDFile=/var/run/spf-milter-python/spfmilter.pid
ExecStart=/usr/bin/spfmilter
[Install]
WantedBy=multi-user.target
And thus:
Aug 22 10:28:31 flamen systemd[1]: Started SPF Milter Python.
-- Subject: A start job for unit spf-milter-python.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit spf-milter-python.service has finished successfully.
--
-- The job identifier is 312.
Aug 22 10:28:31 flamen spfmilter[2054]: /usr/bin/spfmilter: 3: cannot create /var/run/spf-milter-python/spfmilter.pid: Directory non
Aug 22 10:28:32 flamen systemd[1]: spf-milter-python.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit spf-milter-python.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 2.
Aug 22 10:28:32 flamen systemd[1]: spf-milter-python.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit spf-milter-python.service has entered the 'failed' state with result 'exit-code'.
This can and should be corrected by using the RuntimeDirectory directive as follows:
[Unit]
Description=SPF Milter Python
Documentation=man:spfmilter(1)
After=network.target
[Service]
Type=simple
User=spf-milter-python
Group=spf-milter-python
RuntimeDirectory=spf-milter-python
PIDFile=/run/spf-milter-python/spfmilter.pid
ExecStart=/usr/bin/spfmilter
[Install]
WantedBy=multi-user.target