From nobody Mon Jul 27 10:17:21 2026 X-Original-To: dev-commits-src-main@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 4h7vfT5Z0nz6mktZ for ; Mon, 27 Jul 2026 10:17:21 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h7vfT37G4z3L42 for ; Mon, 27 Jul 2026 10:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785147441; 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=wN5PQbw0umN6I8RPwHHm6ca8DTKLWP+GbSJbUQIi7dk=; b=M27/RLkzOZ3rPdfF6zlDvdcBfhzvoqlVKRnKEhnRg1P4e0AJqpDuekWtgCwrPmuR6IkNOk pj8BtAc+a4SxRCHgkG6qWn7dI5EoQSFXniB8z4gvHhjteDd+sJaFaEbUUvINT/qrLJKvnO hDH2JI3ryOTZybFpRIFaPKAmi8LOwPbnsYY/Z72N3r1Gk/LHFsH1qYkewN0COZvLbotkMx RTgUzJlfpi2Nc57MwIOubtFylxn30cOFgrTTw03jewNQTY9qIdpb9n24kkobUWR2hLhPO+ gt0LeRgFTAGsnGFbsYzWl2ZbvuC6uU+vjJ8jYTIcdpjgvmkQ8J46lr3/Kl44bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785147441; a=rsa-sha256; cv=none; b=v4RRfluNmIZ2LyN7Iet7LF6jcDTI34ytrJOIhSwihIaxcpE2Rk3VZ3u5qStRe3IZesc7Vw BRQSTM/b0bbHuYx4YpKsmH7m2D4xp+0QixslQLE9r4vp1VF36yzr6HN9D4I8P/egdJ+fdT PeDvPsey3f9DZWdPJmCVSciGzBJ054NzlPhH0AHU98YMpCwU683QRzlxJWbCZtkRDGnKBv CJ6CynOIEUYAUCCFhOhUjJ5JZJfq36TcWjRBzRolSjxVIozLFxsB7M3pZIAiz0gvL9Hemf pgm/S6WRUC7GhjvT/ZFKxNNFBlnNz5GkDxvvUhN8vQbjp7FEPzLZwa7IfL92Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785147441; 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=wN5PQbw0umN6I8RPwHHm6ca8DTKLWP+GbSJbUQIi7dk=; b=gCxzOjVnNaHnYXheOcMUgR2NwM45EWNbaXFi5pdWsE3pLNVB6T9Gn3Ft9M6fI5ree3oV+2 ik4V723uMV1Gi0ylX1OXLINOtIoNoFwaXpxVIKYSWTM8iVsCT4tjB6f+iFRRXFwNFZNIE9 cOTd6n0QU8Ike2P0GTilpDBdpzuJ6GROADJwey1owbSLPW1GjaPAGJ7oNjPBaZUg1WzNwc FQenqhfeelGwf6KuAw7V1x31qmsvPUgcYvLIAWt6i2aEeLIrgH80Jyv6sEEu5MNd+EvpBs bJdoXJlKbPRUxPLqs3UztlmN6zSEHrCAeAV/XgEbyvHWfV7Zn4ynT80yxDyFhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h7vfT2509z14MT for ; Mon, 27 Jul 2026 10:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f4b1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 27 Jul 2026 10:17:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 356d0b79cf6f - main - rc.subr: Fix premature return from wait_for_pids List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 356d0b79cf6fc693ed1a5564232e240ce15ccb8a Auto-Submitted: auto-generated Date: Mon, 27 Jul 2026 10:17:21 +0000 Message-Id: <6a673031.1f4b1.1984bdcc@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=356d0b79cf6fc693ed1a5564232e240ce15ccb8a commit 356d0b79cf6fc693ed1a5564232e240ce15ccb8a Author: Dag-Erling Smørgrav AuthorDate: 2026-07-27 10:15:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-07-27 10:15:47 +0000 rc.subr: Fix premature return from wait_for_pids Use pwait's new -r option to wait until the target processes have not only terminated, but also been reaped. PR: 293183 MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D58391 --- UPDATING | 12 ++++++++++++ libexec/rc/rc.subr | 4 ++-- libexec/rc/tests/rc_subr_test.sh | 20 ++++++-------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/UPDATING b/UPDATING index e9ed0d97727a..442fcad7232e 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260722: + The wait_for_pids() function in rc.subr, used by rc scripts + when stopping or restarting a service, has been modified to + use pwait(1)'s new -r option, which requires kernel support. + When upgrading across this change, you should install a new + kernel first, then reboot, then install a new world, run + etcupdate, and reboot again. Otherwise, you may find that + rc.subr is unable to stop services because the running kernel + does not provide the support that the updated pwait(1) needs. + Alternatively, if you deem it safe, you may use fastboot(8) to + reboot without shutting down services first. + 20260620: On powerpc64le, long double is now IEEE 754 binary128 (quad precision, 113-bit mantissa) instead of 64-bit double. This is an diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 7cb652e5ec17..0602178f42b4 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -803,7 +803,7 @@ sort_lite() # wait_for_pids() { - local _list _prefix _j + local _list= _prefix= _j= for _j in "$@"; do if kill -0 $_j 2>/dev/null; then @@ -814,7 +814,7 @@ wait_for_pids() while [ -n "$_list" ]; do echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " - _list=$(pwait -op $_list 2>/dev/null) + _list=$(pwait -opr $_list 2>/dev/null) done if [ -n "$_prefix" ]; then echo "." diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 9ddd13b61a7c..4754ad83c290 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -123,20 +123,12 @@ wait_for_pids_progress_head() } wait_for_pids_progress_body() { - cat >>script <<'EOF' -. /etc/rc.subr -sleep 15 & -a=$! -sleep 10 & -b=$! -sleep 5 & -c=$! -wait_for_pids $a $b $c -EOF - re="^Waiting for PIDS: [0-9]+ [0-9]+ [0-9]+" - re="${re}, [0-9]+ [0-9]+" - re="${re}, [0-9]+\.$" - atf_check -s exit:0 -o match:"${re}" /bin/sh script + a=$(sleep 4 >/dev/null & echo $!) + b=$(sleep 3 >/dev/null & echo $!) + c=$(sleep 2 >/dev/null & echo $!) + atf_check \ + -o inline:"Waiting for PIDS: $a $b $c, $a $b, $a.\n" \ + /bin/sh -c ". /etc/rc.subr; wait_for_pids $a $b $c" } atf_init_test_cases()