mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
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
This commit is contained in:
parent
99475087d6
commit
5953e7c984
1 changed files with 4 additions and 1 deletions
|
|
@ -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 "."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue