Page MenuHomeFreeBSD

rc.subr: Fix slow shutdown issue
ClosedPublic

Authored by des on Oct 23 2025, 10:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 27, 12:29 AM
Unknown Object (File)
Sun, Nov 23, 12:41 AM
Unknown Object (File)
Wed, Nov 19, 5:34 AM
Unknown Object (File)
Tue, Nov 11, 6:39 PM
Unknown Object (File)
Tue, Nov 4, 6:08 PM
Unknown Object (File)
Mon, Nov 3, 7:18 PM
Unknown Object (File)
Mon, Nov 3, 7:14 PM
Unknown Object (File)
Sat, Nov 1, 3:29 AM
Subscribers

Details

Summary

Instead of sleeping after pwait returns, use its new -p option to
obtain the list of processes that still have not terminated.

Fixes: 5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68046
Build 64929: arc lint + arc unit

Event Timeline

des requested review of this revision.Oct 23 2025, 10:29 AM
markj added inline comments.
libexec/rc/rc.subr
797

Presumably this should be for _j in $@?

des marked an inline comment as done.Oct 27 2025, 11:40 AM
des added inline comments.
libexec/rc/rc.subr
797

from sh(1):

The syntax of the for command is:

for variable [in word ...]
    do list
    done

If in and the following words are omitted, in "$@" is used instead.

des marked an inline comment as done.Oct 27 2025, 11:40 AM
markj added inline comments.
libexec/rc/rc.subr
804

I think this check is unnecessary: if $_list is empty, the following code will do nothing.

This revision is now accepted and ready to land.Oct 27 2025, 1:13 PM
0mp added a subscriber: 0mp.

otherwise, seems OK

libexec/rc/rc.subr
797

I think for _j in "$@"; do would be better here. Omitting in "$@" is unnecessarily cryptic and also a lot of other for loops in rc.subr use in "$@".

des marked 2 inline comments as done.Oct 27 2025, 6:09 PM
This revision now requires review to proceed.Oct 27 2025, 7:31 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 28 2025, 11:58 AM
This revision was automatically updated to reflect the committed changes.