Bug 277003

Summary: security/munge: service munged restart sometimes fails
Product: Ports & Packages Reporter: Jason W. Bacon <jwb>
Component: Individual Port(s)Assignee: Muhammad Moinur Rahman <bofh>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (bofh)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Unified diff for more robust RC script
none
Unified diff for more robust RC script
none
Unified diff for more robust RC script
none
Unified diff for more robust RC script none

Description Jason W. Bacon freebsd_committer freebsd_triage 2024-02-12 14:00:01 UTC
Created attachment 248391 [details]
Unified diff for more robust RC script

The problem is that the munged_stop() function does not wait until the kill completes.  This can cause start to fail with "munged already running" when the system is heavily loaded and kill is slower than usual.  Attaching a patch for a more robust RC script.
Comment 1 Jason W. Bacon freebsd_committer freebsd_triage 2024-02-12 14:08:56 UTC
Created attachment 248392 [details]
Unified diff for more robust RC script

Crap...

Original patch was an unfinished attempt.
Comment 2 Jason W. Bacon freebsd_committer freebsd_triage 2024-02-13 00:05:36 UTC
Created attachment 248413 [details]
Unified diff for more robust RC script

Add checkyesno to stop function, so rc.conf is checked appropriately
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2024-02-13 22:09:11 UTC
Do you have a git diff from the tree?
Comment 4 Jason W. Bacon freebsd_committer freebsd_triage 2024-02-15 13:27:42 UTC
Created attachment 248481 [details]
Unified diff for more robust RC script
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2024-02-15 23:28:30 UTC
Thanks. :)

I will look at this on the coming weekend.
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-02-19 06:27:42 UTC
A commit in branch main references this bug:

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

commit 935bde5ee133f8c93dd67123827c075bc6ac2538
Author:     Jason W. Bacon <jwb@freebsd.org>
AuthorDate: 2024-02-19 06:14:36 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-02-19 06:26:39 +0000

    security/munge: Fix rc script

    The problem is that the munged_stop() function does not wait until the
    kill completes. This can cause start to fail with "munged already
    running" when the system is heavily loaded and kill is slower than
    usual.

    PR:             277003

 security/munge/Makefile                  |  2 +-
 security/munge/files/munged.in (mode +x) | 21 +++++++++++++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)