From nobody Thu Oct 2 08:20:54 2025 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 4ccl9g53xRz69KVC; Thu, 02 Oct 2025 08:20:55 +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 4ccl9g0yp4z4NRT; Thu, 02 Oct 2025 08:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393255; 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=I8MGBwHFJKOXe+42+cu5LxE/wPTZDx/Tu5E8m1bVWas=; b=lNY0TMobD1hVqKyy57VPdWdMmbgwLQwt3KTsIIxgVxOfkWvUtNXhMYloWL5cwh8LJ9eCEO 174ZatxAik+SrmftCYwpWXnYQQOUbxlOe5NMwYuEeuJLdrlqCFgVzwGhtdMjyj9WjJKNoN JG9SJvSxayB3wkcU1NT681JXl/OlLlhQ/7puK2lZ/pRPgI25idKTdpIZS1hCZODPc+WAT4 +hedS+xKolfbhJ/ZSz2Ol3U6NK5ya0tDg2/38/xhVDq2rEA33XATWIVRMhl5MqAurBlSGT 1kOJiPR1McGL6JGuujGY4v+b7XsUfReETvHFlIWYoiiPJFFlOQbLjwCwub+ZUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393255; 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=I8MGBwHFJKOXe+42+cu5LxE/wPTZDx/Tu5E8m1bVWas=; b=wPVGG/IH3cVyBpc0tEjuoz/BwCKejS7r2S0bPcCJFrb8w9JljQoA64wQLL2Q2PaMWY5Y+V XvOLEWAp5I2xv8bkRPCAPyluoAcZSyNf49tLe4pQB/EIbo5cGKSnhqWBjHY7Bxtv6Om9Ee 7N1U0hucxU23JV19+CoCaaelNXpFuAOGZXYfXwdB64H8eD6HFrw0XqvOmIUOOZtBFhO1Bv 2bJngfVG1ukrmuDjEO2nwn8nSNDUVmL4XqUCgCnFielip8oBstZAqI8T8uKzOGzaiCmGKq ttRBTKQAYSnH8KqJINZqqwYEQALdBJrIbgoHM3ZIf/zd72atD44fTO1z5cW5zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393255; a=rsa-sha256; cv=none; b=Vo6hpID2d4tCCWvDQtdifGOdUS6Vf0+Ewn546RZqp/za7Ll5BmvbYa+a76QvD0fTBu7V/4 6oPgVRFJJrrHPkiXf7uUTLXMn37LdvbdBF2pmItA5dVeiV89YpkvqiDZQFyrqr6tSRW2sY 30ULhkArocT/SOo9vyRIbaD4bZrE3PmKY5hcCbFt2CkTgP6AE7ekrbR8RIFipU/WkKLCad PuIoJaExs5TuhrqELCelgiHN22E81xJNStbjQ5ErBREYpZwF99qjSxvHBwGBi6szXK5LEU pzPRe2OQ4F2NsWWwzojusjjz8DuusF+X50UOObK+Pp224N2zK+b7NXPqtgasYg== 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 4ccl9g0PjZz10VN; Thu, 02 Oct 2025 08:20:55 +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 5928KsAo023627; Thu, 2 Oct 2025 08:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Ksqk023624; Thu, 2 Oct 2025 08:20:54 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:54 GMT Message-Id: <202510020820.5928Ksqk023624@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 50f554a5475f - stable/14 - rc.subr: Move the sleep in 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 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/14 X-Git-Reftype: branch X-Git-Commit: 50f554a5475fa274d7b832e2f7fa5add0218f222 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=50f554a5475fa274d7b832e2f7fa5add0218f222 commit 50f554a5475fa274d7b832e2f7fa5add0218f222 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:55:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:57 +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 (cherry picked from commit 5953e7c98427e038500221e885dffa181dcc064b) --- 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 5423af476ad0..a4f3762afd2c 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -646,7 +646,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 @@ -656,6 +655,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 "."