diff --git a/libexec/rc/rc.d/virtual_oss b/libexec/rc/rc.d/virtual_oss index 07f81aeed4b..dd3bbe41c09 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