From nobody Tue Sep 23 12:59:07 2025 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 4cWKmq5vHQz68ch1; Tue, 23 Sep 2025 12:59:07 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cWKmq5Hgdz3WC7; Tue, 23 Sep 2025 12:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758632347; 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=hwelhLCI2MWWo1HVkLj+p593YYYz2jVWVuNNWkyzcfc=; b=soUfIG8kfz9Ta4cqUpyYs2iIInhoSycRqRHjHNcTQGKSKaAoBxbIJKy+qLdlr8HJepz5+1 CdLK1QU4Xx1R5zmzHJan81Vm9YwrFdSvWtrSsVXb4pmGpGOsQe8HGjHOeXkb8U8YSij4oT iAgSgdICM8k9xn7/b7FDIoApACsQtkciJcH2HkVlSEbgGxxNEr/SOKc3K1Zag85mkH+hHX F9V+bKZ/x0tVt9oGYUt5Vcw75AFZa4LQgyr0UG8ofBv3e+unAh3esHMWrVyU24TrZxrK9r YB9v0q0DOQcULnBtq2IyHsoK5NwSdas95W8JPI/a+42XBCUZ3D4cDKw60nW8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758632347; 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=hwelhLCI2MWWo1HVkLj+p593YYYz2jVWVuNNWkyzcfc=; b=xV1QoabV5QUh+hLkIECT7iLxlU00LoPSEcMfKLKWlIe5gTiMQlWRmHDzouU4060Fjo0JVK 7qHwBiWCqesDJ2d3fjJUl6VS1qzGMkpixraAIuxID0qqxa0n4ucLHneupVCobNEK5iXath nHnCcRSBu39TPD6N68Q17kgQfhhnvIhIOEL/IoMDiJk70JOcVbtfOkfbS8PvOgHcud1E+2 SaujaQiJrM+Jh7JzxEMQam0admQDKHGNaG9ELafTAABlN+bNjJI3sPAablrp7i8b21ZPBK DEtMevj79uUluyBnMYyl5JLtKeo8fvNSxAaeXvKbJD8qsAj+lkHl2AYmrOzftQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758632347; a=rsa-sha256; cv=none; b=Jvr5Aujso4EqNTWcn1iWIARdi4OUlmS9e6+rgoWCXD60r5xkP3tncmR+EkgrS0NvbTDPwt eOerdsuKi8ViSf2+TeTXrCPeuf0FcPgjSx4kwv8J6/QreiJe51KAcsFl/BOIRrR7DQRE+5 bBa+9RI36TAZIS9umlqEmOhZtpItKGE1YV/TR8lduX3uhky8M4d5qy52529AVaLWeE2yjy GdjAgI6CHhgSvFrA3VfmlSnEcckg3LWuxgXbzH24iX4p8A3kWP2r8xSByVp7CvQdN2iXKv v/tqGmu97bnyw6e7dX4nhc1P34sKn6io/XI0WaSFCj8KdG4fBo/LvqXKEGYfaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cWKmq4vN4znDK; Tue, 23 Sep 2025 12:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58NCx72Q004782; Tue, 23 Sep 2025 12:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58NCx7X0004779; Tue, 23 Sep 2025 12:59:07 GMT (envelope-from git) Date: Tue, 23 Sep 2025 12:59:07 GMT Message-Id: <202509231259.58NCx7X0004779@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 5953e7c98427 - main - rc.subr: Move the sleep in 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 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: 5953e7c98427e038500221e885dffa181dcc064b Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5953e7c98427e038500221e885dffa181dcc064b commit 5953e7c98427e038500221e885dffa181dcc064b Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:55:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-09-23 12:55:56 +0000 rc.subr: Move the sleep in wait_for_pids Instead of sleeping while constructing the list of PIDs to wait for, sleep briefly after pwait to give init a chance to reap the processes that just terminated before we loop around and start probing them. PR: 289630 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D52619 --- libexec/rc/rc.subr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 06b1bd51384c..6be226021949 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -804,7 +804,6 @@ wait_for_pids() for _j in $_list; do if kill -0 $_j 2>/dev/null; then _nlist="${_nlist}${_nlist:+ }$_j" - [ -n "$_prefix" ] && sleep 1 fi done if [ -z "$_nlist" ]; then @@ -814,6 +813,10 @@ wait_for_pids() echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " pwait -o $_list 2>/dev/null + # At least one of the processes we were waiting for + # has terminated. Give init a chance to collect it + # before looping around and checking again. + sleep 1 done if [ -n "$_prefix" ]; then echo "."