Bug 254762

Summary: mail/opendkim: PID file
Product: Ports & Packages Reporter: Rob LA LAU <freebsd>
Component: Individual Port(s)Assignee: Chris Rees <crees>
Status: New ---    
Severity: Affects Some People CC: crees, dewayne, freebsd-ports
Priority: --- Flags: bugzilla: maintainer-feedback? (freebsd-ports)
Version: Latest   
Hardware: Any   
OS: Any   

Description Rob LA LAU 2021-04-04 14:05:21 UTC
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.
Comment 1 Chris Rees freebsd_committer 2021-04-05 12:47:31 UTC
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.
Comment 2 Rob LA LAU 2021-04-09 11:51:41 UTC
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
Comment 3 Chris Rees freebsd_committer 2021-04-09 14:21:51 UTC
The modified script creates the parent directory of $pidfile; ${pidfile%/*} removes the shortest suffix (i.e. is equivalent to $(dirname $pidfile)).
Comment 4 Rob LA LAU 2021-04-09 14:38:27 UTC
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
Comment 5 Chris Rees freebsd_committer 2021-04-15 11:29:50 UTC
*** Bug 230685 has been marked as a duplicate of this bug. ***