git: 71f6592a0150 - main - rc.subr: Remove misguided cpuset usage

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 18 Nov 2025 16:24:45 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=71f6592a01506899efd91306b6d8147f14a6b219

commit 71f6592a01506899efd91306b6d8147f14a6b219
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-11-17 16:45:44 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-11-18 16:24:21 +0000

    rc.subr: Remove misguided cpuset usage
    
    When running an rc command, if the target rc script defines
    <command>_cmd, e.g., start_cmd=..., then the run_rc_command() executes
    that instead of $command.  In general it's a shell function, and
    "cpuset -l <n> <shell function>" doesn't work.
    
    Moreover, it doesn't really make sense to run cpuset for anything other
    than start_cmd.
    
    Other optional isolation mechanisms (e.g., <name>_fib,
    <name>_chroot) are only used when invoking $command directly as part of
    the "start" command.  Make <name>_cpuset consistent with everything else
    by removing these extraneous cpuset invocations.
    
    Reviewed by:    0mp
    MFC after:      2 weeks
    Sponsored by:   Modirum MDPay
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D53746
---
 libexec/rc/rc.subr | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr
index 4718123a71e9..b0b255e8b6ff 100644
--- a/libexec/rc/rc.subr
+++ b/libexec/rc/rc.subr
@@ -1375,7 +1375,7 @@ run_rc_command()
 				_run_rc_precmd || return 1
 			fi
 			if ! checkyesno ${name}_svcj; then
-				_run_rc_doit "$_cpusetcmd $_cmd $rc_extra_args" || return 1
+				_run_rc_doit "$_cmd $rc_extra_args" || return 1
 			else
 				case "$rc_arg" in
 				start)
@@ -1404,7 +1404,7 @@ run_rc_command()
 							    name=svcj-${name} && _return=0
 						fi
 					else
-						_run_rc_doit "$_cpusetcmd $_cmd $rc_extra_args" || _return=1
+						_run_rc_doit "$_cmd $rc_extra_args" || _return=1
 					fi
 					;;
 				stop)
@@ -1412,7 +1412,7 @@ run_rc_command()
 						$SERVICE -E _rc_svcj=jailing -j svcj-${name} ${name} ${_rc_prefix}stop $rc_extra_args || _return=1
 						$JAIL_CMD -r svcj-${name} 2>/dev/null
 					else
-						_run_rc_doit "$_cpusetcmd $_cmd $rc_extra_args" || _return=1
+						_run_rc_doit "$_cmd $rc_extra_args" || _return=1
 					fi
 					;;
 				restart|status) ;; # no special case needed for svcj or handled somewhere else
@@ -1422,7 +1422,7 @@ run_rc_command()
 					if checkyesno _rc_svcj_extra_cmd && [ "${_rc_svcj}" != jailing ]; then
 						$SERVICE -v -E _rc_svcj=jailing -j svcj-${name} ${name} ${_rc_prefix}${rc_arg} $rc_extra_args || _return=1
 					else
-						_run_rc_doit "$_cpusetcmd $_cmd $rc_extra_args" || _return=1
+						_run_rc_doit "$_cmd $rc_extra_args" || _return=1
 					fi
 					;;
 				esac