Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jun 2026 21:19:40 +0000
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b8a97cc677df - stable/15 - rc: virtual_oss: Wait for process to exit
Message-ID:  <6a25e06c.4723b.79a248e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=b8a97cc677dfbb38b6c333d00e241cfdf223a684

commit b8a97cc677dfbb38b6c333d00e241cfdf223a684
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-05-21 16:26:46 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-06-07 21:19:34 +0000

    rc: virtual_oss: Wait for process to exit
    
    Sometimes virtual_oss processes do not exit immediatelly. If we do not
    wait for the processes to fully exit before returning from
    virtual_oss_stop(), then the service restart operation might call
    virtual_oss_start() too early and fail, because it will think the
    service wasn't stopped and is still running.
    
    Reported by:    jrm
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    0mp, jrm
    Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
    
    (cherry picked from commit 803f686938ec2472d54a26bff668e48cc4999558)
---
 libexec/rc/rc.d/virtual_oss | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libexec/rc/rc.d/virtual_oss b/libexec/rc/rc.d/virtual_oss
index 07f81aeed4bc..dd3bbe41c094 100644
--- a/libexec/rc/rc.d/virtual_oss
+++ b/libexec/rc/rc.d/virtual_oss
@@ -76,8 +76,10 @@ stop_instance()
 	if [ -z "${instance_args}" ]; then
 		warn "no such config: ${config}"
 	else
+		pid="$(cat "${pidpath}/${config}.pid")"
 		startmsg -n "Stopping virtual_oss config: ${config}: "
-		kill "$(cat "${pidpath}/${config}.pid")"
+		kill "${pid}"
+		pwait "${pid}"
 		rm -f "${pidpath}/${config}.pid"
 		startmsg "done"
 	fi


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a25e06c.4723b.79a248e>