git: 2c9ed2b6a129 - stable/15 - rc.subr: svcj - let svcj_all_enable enable service jails

From: Alexander Leidinger <netchild_at_FreeBSD.org>
Date: Sun, 06 Sep 2026 10:01:21 UTC
The branch stable/15 has been updated by netchild:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c9ed2b6a129d25850069c3ad75ce696c92f6212

commit 2c9ed2b6a129d25850069c3ad75ce696c92f6212
Author:     Alexander Leidinger <netchild@FreeBSD.org>
AuthorDate: 2026-08-30 09:44:55 +0000
Commit:     Alexander Leidinger <netchild@FreeBSD.org>
CommitDate: 2026-09-06 09:58:44 +0000

    rc.subr: svcj - let svcj_all_enable enable service jails
    
    Fix the logic for svcj_all_enable.
    
    Fixes:          2efbd480f1d3 rc: add service jails framework
    MFC after:      1 week
    MFC to:         stable/15
    
    (cherry picked from commit 21e53eeaffcac0be3427b7edb3b8739344a65174)
---
 libexec/rc/rc.conf | 2 ++
 libexec/rc/rc.subr | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index ba61bd43a37a..11ec74b93a23 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -758,6 +758,8 @@ jail_confwarn="YES"	# Prevent warning about obsolete per-jail configuration
 jail_parallel_start="NO"	# Start jails in the background
 jail_list=""		# Space separated list of names of jails
 jail_reverse_stop="NO"	# Stop jails in reverse order
+svcj_all_enable="NO"	# Run all services in a service jail unless
+						# they are explicitly excluded
 
 ##############################################################
 ### Define source_rc_confs, the mechanism used by /etc/rc.* ##
diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr
index 8abadb2e99b2..0a8acc7ed604 100644
--- a/libexec/rc/rc.subr
+++ b/libexec/rc/rc.subr
@@ -1162,8 +1162,9 @@ run_rc_command()
 	if [ -z "$_svcj" ]; then
 		_svcj=${svcj_all_enable}
 		if [ -z "$_svcj" ]; then
-			eval ${name}_svcj=NO
+			_svcj=NO
 		fi
+		eval ${name}_svcj=$_svcj
 	fi
 
 					# setup pid check command