Bug 292404 - mail/mailman3: Update rc.d script
Summary: mail/mailman3: Update rc.d script
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: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-12 14:10 UTC by Einar Bjarni Halldórsson
Modified: 2026-08-16 19:17 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback+


Attachments
Update rc.d script (2.15 KB, patch)
2026-01-12 14:11 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval+
Details | Diff
Fixed rc script, now removing *.orig files and using `status` instead of `start` (2.32 KB, patch)
2026-05-13 13:22 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval+
Details | Diff
Rebase on current (1.79 KB, patch)
2026-06-16 09:22 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Einar Bjarni Halldórsson 2026-01-12 14:10:41 UTC
The mailman rc.d script has two problems:

`service mailman start` prints ugly error if the service is already started

`service mailman status` returns code 0 if the service is not running, 1 if it is running (see https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/bin/master.py#L105)
This causes problems with tools like ansible, where the service module assumes rc 1 means that the service isn't running and 0 that it is.
Comment 1 Einar Bjarni Halldórsson 2026-01-12 14:11:58 UTC
Created attachment 267082 [details]
Update rc.d script
Comment 2 Älven freebsd_committer freebsd_triage 2026-01-18 15:04:37 UTC
Should be easy to do, just need to wait for some more time when my committers became available to review PRs I'm to commit.
Comment 3 Einar Bjarni Halldórsson 2026-03-02 09:00:14 UTC
(In reply to Älven from comment #2)

Friendly bump
Comment 4 Einar Bjarni Halldórsson 2026-03-30 15:18:08 UTC
so, any chance to get this comitted?
Comment 5 Älven freebsd_committer freebsd_triage 2026-04-01 11:48:01 UTC
Yes. I'm very sorry for so long delay. Tested OK. Now waiting for approval from my mentors.
Comment 6 Einar Bjarni Halldórsson 2026-05-13 13:22:07 UTC
Created attachment 270694 [details]
Fixed rc script, now removing *.orig files and using `status` instead of `start`

Took a better look at the patch. Don't know why I used `start` in mailman_status, but apparently it didn't break anything. It should still be `status`.

Also added back in a post-patch step to remove *.orig files
Comment 7 Einar Bjarni Halldórsson 2026-06-16 09:22:36 UTC
Created attachment 271848 [details]
Rebase on current
Comment 8 Älven freebsd_committer freebsd_triage 2026-08-16 08:55:12 UTC
Sorry, my mentors may be too busy to review this PR.
I'm returning it to pool and hope other committers will land it quickly.
Comment 9 commit-hook freebsd_committer freebsd_triage 2026-08-16 19:11:28 UTC
A commit in branch main references this bug:

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

commit ae15f89980dff827563056d876641f942a70c6dd
Author:     Einar Bjarni Halldórsson <einar@isnic.is>
AuthorDate: 2026-08-16 19:09:12 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-08-16 19:10:45 +0000

    mail/mailman3: Update rc.d script

    Fix the exit code of "service mailman status".  Mailman's own status
    command exits 0 when it is not running and 1 when it is, which is the
    inverse of the rc.subr convention.  Wrap it so that a running master
    yields 0, as service(8) consumers such as Ansible expect.

    Also add a start_precmd that detects an already running master via the
    pidfile, so that "service mailman start" no longer dumps a full click
    usage block on a second invocation.

    PR:             292404
    Sponsored by:   Netzkommune GmbH

 mail/mailman3/Makefile         |  2 +-
 mail/mailman3/files/mailman.in | 25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-08-16 19:17:30 UTC
A commit in branch 2026Q3 references this bug:

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

commit 15033a23ac4f603e23ad01a7b649acd95be83b25
Author:     Einar Bjarni Halldórsson <einar@isnic.is>
AuthorDate: 2026-08-16 19:09:12 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-08-16 19:15:13 +0000

    mail/mailman3: Update rc.d script

    Fix the exit code of "service mailman status".  Mailman's own status
    command exits 0 when it is not running and 1 when it is, which is the
    inverse of the rc.subr convention.  Wrap it so that a running master
    yields 0, as service(8) consumers such as Ansible expect.

    Also add a start_precmd that detects an already running master via the
    pidfile, so that "service mailman start" no longer dumps a full click
    usage block on a second invocation.

    PR:             292404
    Sponsored by:   Netzkommune GmbH

    (cherry picked from commit ae15f89980dff827563056d876641f942a70c6dd)

 mail/mailman3/Makefile         |  2 +-
 mail/mailman3/files/mailman.in | 25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)