mirror of
https://git.FreeBSD.org/src.git
synced 2026-06-02 11:24:32 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user