The rc script for opendkim sets the variables _piddir and pidfile. However, the configuration file opendkim.conf also contains a PidFile variable, which is now ignored. If it is necessary to have the configuration variable overwritten by the rc script (?), a comment should be added to the PidFile variable in the configuration file, to indicate that this var has now become useless. Also, a comment should be added to the BaseDirectory and Socket variables in the configuration file (and their default values modified), to indicate that a directory /var/run/milteropendkim is created by the rc script; this would allow a sysadmin to keep all runtime data in the same directory.
Please take a look at this, which respects PidFile being set if set in the config file: https://reviews.freebsd.org/D29586 I haven't addressed the second comment part, but I think to be honest that /var/run/$name being created is so standard it doesn't really need special mention. It will cause conflicts if PidFile is set to the same as another, so perhaps a check if the pidfile exists might be in order, would be easy to add to dkim_get_pidfile.
Looks good. Problem with the /var/run/* directory is that you normally expect settings like those to just work. However, currently, the opendkim.conf file points at /var/run/opendkim, while the rc script creates the directory /var/run/milteropendkim. Cheers, Rob
The modified script creates the parent directory of $pidfile; ${pidfile%/*} removes the shortest suffix (i.e. is equivalent to $(dirname $pidfile)).
I'm sorry, you are right. I had a look at it while I was doing other things. Yes, this looks good. Have a nice weekend, Rob
*** Bug 230685 has been marked as a duplicate of this bug. ***
Fixed, so close.
Not committed yet!
*Now* it's fixed :) Thanks for reporting!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=0e46cdf18498118d3309812946e1df0245d62cb0 commit 0e46cdf18498118d3309812946e1df0245d62cb0 Author: Chris Rees <crees@FreeBSD.org> AuthorDate: 2022-01-14 17:56:38 +0000 Commit: Chris Rees <crees@FreeBSD.org> CommitDate: 2022-01-14 18:01:28 +0000 mail/opendkim: Respect PidFile setting in opendkim.conf While here, pet rclint a bit, though it doesn't like the profile parts not being in functions PR: ports/254762 Reported by: Rob LA LAU <freebsd@ohreally.nl> Reviewed by: skozlov (a previous iteration) Approved by: maintainer timeout, 9 months Differential Revision: https://reviews.freebsd.org/D29586 mail/opendkim/Makefile | 2 +- mail/opendkim/files/milter-opendkim.in | 98 ++++++++++++++++------------------ 2 files changed, 48 insertions(+), 52 deletions(-)