From nobody Mon Feb 19 06:26:52 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdXcr6QWtz59lnN; Mon, 19 Feb 2024 06:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdXcr57yTz3xK5; Mon, 19 Feb 2024 06:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708324012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BASzLfcuNgb4FqaHvMHIPEwWBXZILLoOZPHQJL7NWPw=; b=tZfi2Z+Ws8saR1HraIcFJZo2d+/2oYt0/qmGO5wGVz6LUzej/TxMd16QiYFsGhomAoM+nH Uf5mGG2wy2ux3hoCHpbwRvmOuzazhkSbJFBvT0PFWYFXXDSF2fZiHMuQKfDfCk/BgViurA BQln/6mBnNa1d3IWVnPvjScHYR1lSbaYM5FXJhVAA6UcAN61xBE0NxohLRauQF74tjVcOX 9S1db1yCbK9r2i0oXJEyns7rbnGJ2VUtw3X2eR0xZmDA8VxQxCXkaFQHbiZmPrxsIgbR0e QSHFIwKStC2jhtsc6ubNZuCq1ozUqby+SUk65IFABakQ3+0MnhfuZy4Tl07Gzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708324012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BASzLfcuNgb4FqaHvMHIPEwWBXZILLoOZPHQJL7NWPw=; b=Gmv4gkyOtVbq5P45YAj5195OD1UA3WtQRj1LdTAhBOC+jv6yyo5sKyGIthVYSpVXlAH5yR +nVeZqbxM3gmUwREwLzG0NlcpZXtxEHBPDg2emfS/6pyE4hn/OsJQWIIklffvU/7wNZ81V QTU1qhuxs1XwgTLrDf8AmI1IX6vWbRDeWcJPLJwzV7s4q+4vEnmfjJJqkGf9sjMT7dEZGW NPXS6hlgAT7yOFzdAq02qXWJ1JJM2XsTk04MOBKnAzEtEBkGY9+mfSJkrOQDS12YeqY7AO DJWJCvLNjkBSPjrz3EUSYidruF5GBIisANXzfCvPwX60Ie+kFpx2LsOMrbTcag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708324012; a=rsa-sha256; cv=none; b=ZlY2qcu2/44uELmJ79LUkWIVQRQjSx3nistikdH66bWoTMQB6hw1tqPQfGZHYufoqeDmLj BmoQuonTdCSX4L7HTUlw/6Px4KO4L4kGBZw/refoutatQaPRyJl9f7fiQ0q0Rt73AIOFGy lB6eIgCeVsVb2o7RS3lMLGQZInAY9l6AFnKGV/o1wtjetSsNoBbGmWfbErxb4BPQDXX5b1 94ILCDqaNsH4uSsrOffCbZYSHRuO/Sm46Cun/12+ErqfDRoxHP2Qpa2mMcTcuLw4naxa8M 5Z+dFnn8c2CzEv517LhvE5PJoJhsBI0y/xbVOd1ePBnkXSjzAf31SaOtRqHkGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdXcr4FV0zNRQ; Mon, 19 Feb 2024 06:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J6Qq6P046137; Mon, 19 Feb 2024 06:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J6Qqj8046134; Mon, 19 Feb 2024 06:26:52 GMT (envelope-from git) Date: Mon, 19 Feb 2024 06:26:52 GMT Message-Id: <202402190626.41J6Qqj8046134@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 935bde5ee133 - main - security/munge: Fix rc script List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 935bde5ee133f8c93dd67123827c075bc6ac2538 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=935bde5ee133f8c93dd67123827c075bc6ac2538 commit 935bde5ee133f8c93dd67123827c075bc6ac2538 Author: Jason W. Bacon AuthorDate: 2024-02-19 06:14:36 +0000 Commit: Muhammad Moinur Rahman 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 | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/security/munge/Makefile b/security/munge/Makefile index fc2e5360a3ea..f0b232fb692c 100644 --- a/security/munge/Makefile +++ b/security/munge/Makefile @@ -1,6 +1,6 @@ PORTNAME= munge DISTVERSION= 0.5.15 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= https://github.com/dun/${PORTNAME}/releases/download/${PORTNAME}-${DISTVERSION}/ diff --git a/security/munge/files/munged.in b/security/munge/files/munged.in old mode 100644 new mode 100755 index 4a78b22acd4c..80bba011209f --- a/security/munge/files/munged.in +++ b/security/munge/files/munged.in @@ -7,7 +7,7 @@ # Add the following line to /etc/rc.conf to enable munged: # munged_enable (bool): Set to "NO" by default. # Set it to "YES" to enable munged. -# munged_keyfile (str): Set to "/usr/local/etc/munge/munge.key" by default. +# munged_keyfile (str): Set to "%%PREFIX%%/etc/munge/munge.key" by default. # Custom munge key. # munged_pidfile (str): Set to "/var/run/munged.pid" by default. # Custom PID file path and name. @@ -31,10 +31,23 @@ command_args="--key-file=${munged_keyfile}" munged_stop() { - if [ -f "${pidfile}" ]; then - kill `cat ${pidfile}` + if checkyesno $rcvar; then + echo "Stopping $name." + pids="$(pgrep -d ' ' $name)" + if [ -n "$pids" ]; then + echo "Waiting for PIDs: $pids" + for signal in TERM INT QUIT KILL + do + kill -s $signal $pids + sleep 1 + pids=$(pgrep -d ' ' $name) + if [ -z "$pids" ]; then + break + fi + done fi - + rm -f $pidfile + fi } run_rc_command "$1"