git: 21e53eeaffca - main - rc.subr: svcj - let svcj_all_enable enable service jails

From: Alexander Leidinger <netchild_at_FreeBSD.org>
Date: Sun, 30 Aug 2026 17:43:49 UTC
The branch main has been updated by netchild:

URL: https://cgit.FreeBSD.org/src/commit/?id=21e53eeaffcac0be3427b7edb3b8739344a65174

commit 21e53eeaffcac0be3427b7edb3b8739344a65174
Author:     Alexander Leidinger <netchild@FreeBSD.org>
AuthorDate: 2026-08-30 09:44:55 +0000
Commit:     Alexander Leidinger <netchild@FreeBSD.org>
CommitDate: 2026-08-30 17:42:55 +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
---
 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 e7ce22822515..41820cd26330 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -766,6 +766,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 061611709628..9b72bd5e9c7b 100644
--- a/libexec/rc/rc.subr
+++ b/libexec/rc/rc.subr
@@ -1172,8 +1172,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