From nobody Mon Aug 3 11:38:43 2026 X-Original-To: dev-commits-src-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 4hDF781yp0z6nC43 for ; Mon, 03 Aug 2026 11:38:44 +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 4hDF775nvmz3Rf0 for ; Mon, 03 Aug 2026 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785757123; 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=ukAqjaBS/b7CVokxUDrsbZ6YV7z3tAoFfxHaRkMfqrg=; b=beC+zYhaMFvS/s255JRBoG5l6Iz44fgN0OqNi3gC0Qau42rNWO3E6pbhxyLHafDPMi8ND+ fUJAJfswRUHK1rMrfEcDeN7uEQRjV/QT+nN4VlDpGx+fL8ME6ib2PiPUdKiCexESaum+cT 2+d+iryl1eApzGLEMPQuzEOvM7s2Oyw74hVqQ8sQkTrtHG2CFuXaOhDC3PKkM8wXnh68td SiE3quO5WymD3TDVpGEdBnwrUybudYYEYANkQyw7sfaSDk2MY5C5WDBCQIKj5wQ+XL2OO7 TVHN2h0Z9JPWRFpMq5BOVysnSgNieT/HsX6duE74ZQPzV0UJ8DQM6ZZ6qxOUMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785757123; a=rsa-sha256; cv=none; b=Y2EuM0Nmym/63JyyuwUX3QxyPYg8S/NyRuCv8y6rOcG5yEjBeyfs6EdBA0H6+aN/ON5u21 3ujOr2FweKVReP/kYSJCv32VOsZ31t63Nd3s+77D/QVCS0ebRmngudc7vA2Tpbdfl1Mi+X Y4SOKQkAHGdqDef7hR/Oom8/i2hySf6feI+1nkPr25O6mptt7A7O+MZN9rCi1diakaiWJv K9CPlVIU8sO+5lF9nYWDo3Sg+LwrPlZ+0tfRfl3J6aJQIWPyd42z4vBzp+GKhHmvZu+Q0q Qwgk5LXKO/uhGZ4QH35cQ8TbMY000bYKnyiJDKc1oWIcxems4dqMZ22lnCXr9Q== 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=1785757123; 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=ukAqjaBS/b7CVokxUDrsbZ6YV7z3tAoFfxHaRkMfqrg=; b=sA5GC3FFXi4Su8DCxiydyp3tC62CMTjZAs6LMDKt9SILAyOQjjPwUsPPtjTzg/pnSr/eV8 rH+ahUKSGkkyTcLJJcxa+6YDkxnEUv63NpsIeyAXQMvxjF4HLY2eoVAx3nShGIZOVsN1cV W6j9L33BgCTk03KBKRB7C8dg9x0J76ZEll1ET0Ugqtba+21NAOXrOXi+tMAKvPeUeOlCqS 94oOj/l8/QuHeKvqpnx2MLv3c8EL8h1okYe1yH5aV1s19rkf+YnVT9lCczTAGsSSfwqgHg gTHctefIvLA1weqZZJGV0bkdaXhCBSKjyPAUHJErDCY2/K9lP8ZjCxFkox2Kbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hDF774p6jzyfP for ; Mon, 03 Aug 2026 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 194e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 03 Aug 2026 11:38:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 237ab146975b - stable/15 - rc.subr: Fix premature return from wait_for_pids List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 237ab146975b42472b86ed73ba64bc7a69881092 Auto-Submitted: auto-generated Date: Mon, 03 Aug 2026 11:38:43 +0000 Message-Id: <6a707dc3.194e0.44e5f20b@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=237ab146975b42472b86ed73ba64bc7a69881092 commit 237ab146975b42472b86ed73ba64bc7a69881092 Author: Dag-Erling Smørgrav AuthorDate: 2026-07-27 10:15:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-08-03 11:32:12 +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 (cherry picked from commit 356d0b79cf6fc693ed1a5564232e240ce15ccb8a) --- 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 137d2aa78e6c..1fc355f24faf 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,18 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +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. + 20260512: "bsdinstall script" will now do a pkgbase installation by default. To revert to the legacy distset installation, set "DISTRIBUTIONS" in diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 451521c038d8..0c5d616f2c07 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -793,7 +793,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 @@ -804,7 +804,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()