Bug 254762 - mail/opendkim: PID file
Summary: mail/opendkim: PID file
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Chris Rees
URL:
Keywords:
: 230685 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-04 14:05 UTC by Rob LA LAU
Modified: 2021-04-15 11:29 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (freebsd-ports)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***