Scenario: - FreeBSD stable/14 at b339da5b23e8 plus minor local patches - Shutting down the system Result: - For every process, the shutdown script waits one second before proceeding to the next one. This results in very long shutdown times for systems with many running functions from /etc/rc.d and /usr/local/etc/rc.d. Note: - This was introduced in 5953e7c98427 and propagated to all branches. - I am currently running with .2 seconds in /etc/rc.subr. I assume that much lower values would also work well, especially on modern machines. -- Martin
I have just changed it to .1 s. This also works well. -- Martin
^Triage: Cc: to original committer.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=22cff1f3e9d82b48aad440c52f883bfd4995359c commit 22cff1f3e9d82b48aad440c52f883bfd4995359c Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-10-28 11:57:03 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-10-28 11:57:16 +0000 rc.subr: Fix slow shutdown issue Instead of sleeping after pwait returns, use its new -p option to obtain the list of processes that still have not terminated. MFC after: 3 days PR: 290357 Fixes: 5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids") Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D53294 libexec/rc/rc.subr | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7b375832c252430243810ca85d6cbf67820457d5 commit 7b375832c252430243810ca85d6cbf67820457d5 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-10-28 11:57:03 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-10-30 10:37:35 +0000 rc.subr: Fix slow shutdown issue Instead of sleeping after pwait returns, use its new -p option to obtain the list of processes that still have not terminated. MFC after: 3 days PR: 290357 Fixes: 5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids") Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D53294 (cherry picked from commit 22cff1f3e9d82b48aad440c52f883bfd4995359c) libexec/rc/rc.subr | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=af13a06ab206b7009f689bf082ecbc776887ecee commit af13a06ab206b7009f689bf082ecbc776887ecee Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-10-28 11:57:03 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-10-30 10:38:19 +0000 rc.subr: Fix slow shutdown issue Instead of sleeping after pwait returns, use its new -p option to obtain the list of processes that still have not terminated. MFC after: 3 days PR: 290357 Fixes: 5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids") Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D53294 (cherry picked from commit 22cff1f3e9d82b48aad440c52f883bfd4995359c) libexec/rc/rc.subr | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-)
A commit in branch releng/15.0 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ac84e695eb4ecdd24185649abfd0b692c303d74e commit ac84e695eb4ecdd24185649abfd0b692c303d74e Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-10-28 11:57:03 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2025-10-30 23:48:19 +0000 rc.subr: Fix slow shutdown issue Instead of sleeping after pwait returns, use its new -p option to obtain the list of processes that still have not terminated. Approved by: re (cperciva) MFC after: 3 days PR: 290357 Fixes: 5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids") Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D53294 (cherry picked from commit 22cff1f3e9d82b48aad440c52f883bfd4995359c) (cherry picked from commit 7b375832c252430243810ca85d6cbf67820457d5) libexec/rc/rc.subr | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-)