trusteddomainproject / OpenDKIM

Other
97 stars 52 forks source link

systemd: use Type=simple and no fork to avoid PIDFile race #146

Open mdomsch opened 2 years ago

mdomsch commented 2 years ago

Red Hat BZ#2056209

ghen2 commented 2 years ago

This just stretches the race condition a little bit.

A better solution is to just drop the PIDFile line and let systemd manage the opendkim process directly (systemd recommends this way of operating).

For example on Arch Linux it's done this way: https://github.com/archlinux/svntogit-community/blob/packages/opendkim/trunk/opendkim.service

mdomsch commented 2 years ago

@ghen2 fair play. We can instead use type=simple and opendkim -f so it doesn't fork. Then we don't care about the PIDFIle at all either.

Tachi107 commented 2 years ago

Looks good!

I have submitted a similar patch to Debian, that also enables various hardening options: https://salsa.debian.org/debian/opendkim/-/merge_requests/3

I'll open a PR here too.