From 05b267e23257a5c89ab2d55888a781bf6f90ec4e Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Mon, 1 Mar 2021 23:18:58 +0100 Subject: [PATCH] service: respect nojailvnet keyword MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the 761d2bb5b9e70cf30f9c2dac62a47a2d2593e83f we added nojailvnet keyword. The nojailvnet keyword is used to skip startup scripts in jails that are run without VNET. The service.sh was omitted in this commit. The service.sh even documents that this is the same code as in rc - so lets reflect that. Submitted by: Adam Wołk Sponsored by: Fudo Security --- usr.sbin/service/service.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 42a50fcf61b9..9646aae67b0c 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -83,6 +83,9 @@ if [ -n "$RESTART" ]; then skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then skip="$skip -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi [ -n "$local_startup" ] && find_local_scripts_new files=`rcorder ${skip} ${local_rc} 2>/dev/null` @@ -113,6 +116,9 @@ if [ -n "$ENABLED" -o -n "$RCORDER" ]; then skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then skip="$skip -s nojail" + if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + skip="$skip -s nojailvnet" + fi fi [ -n "$local_startup" ] && find_local_scripts_new files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`