Bug 262473 - mail/opendkim: inconsistent PID handling in rc
Summary: mail/opendkim: inconsistent PID handling in rc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-03-10 18:26 UTC by Evilham
Modified: 2022-05-10 20:18 UTC (History)
2 users (show)

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


Attachments
bugfixes to opendkim rc script (1.58 KB, patch)
2022-03-10 18:41 UTC, Evilham
contact: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evilham 2022-03-10 18:26:26 UTC
I found a couple issues with the port that *might* be related to #258011 and certainly are related to #254762.

Out of the box (after installing opendkim), the port behaves in a strange fashion when not using profiles.

After some debugging, I came to realise that this is due to the rc script setting the PID file to:
/var/run/milteropendkim/pid, where /var/run/milteropendkim is not created.

Therefore `service milter-opendkim start` results in the process starting, but status / restart / stop being useless (due to the PID not being created).

This is the first issue.

The second issue resulted when trying to force in the config:
PidFile /var/run/opendkim.pid

Which does not work as the rc script is lacking "dkim_get_pidfile" in the branch that handles a call without arguments and without profiles enabled.


As a work-around, running mkdir /var/run/milteropendkim means that the service works, but these two issues exist in the port and should be solved.
Comment 1 Evilham 2022-03-10 18:41:48 UTC
Created attachment 232371 [details]
bugfixes to opendkim rc script

This patch addresses the two described issues.

With this, the result is that without using profiles:
- If PidFile is not used, service milter-opendkim start works as expected without user intervention
- If PidFile is used in the config, that setting is respected
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-05-10 20:18:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e0c54af8111e5e82e461dc2a15df341a6970801e

commit e0c54af8111e5e82e461dc2a15df341a6970801e
Author:     Evilham <contact@evilham.com>
AuthorDate: 2022-03-10 18:41:48 +0000
Commit:     Bryan Drewery <bdrewery@FreeBSD.org>
CommitDate: 2022-05-10 20:17:23 +0000

    mail/opendkim: Properly create pidfile dir

    Submitted by:   Evilham
    Approved by:    maintainer timeout
    PR:             262473

 mail/opendkim/Makefile                 | 2 +-
 mail/opendkim/files/milter-opendkim.in | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)