From owner-dev-commits-src-all@freebsd.org Wed May 19 13:09:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BDDF641553; Wed, 19 May 2021 13:09:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FlY9P2YnRz4VF4; Wed, 19 May 2021 13:09:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40FE91337E; Wed, 19 May 2021 13:09:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14JD9DnP035425; Wed, 19 May 2021 13:09:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14JD9DKq035424; Wed, 19 May 2021 13:09:13 GMT (envelope-from git) Date: Wed, 19 May 2021 13:09:13 GMT Message-Id: <202105191309.14JD9DKq035424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: f4b38c360e63 - main - rc.d: unbreak sysctl lastload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4b38c360e63a6e66245efedbd6c070f9c0aee55 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2021 13:09:13 -0000 The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f4b38c360e63a6e66245efedbd6c070f9c0aee55 commit f4b38c360e63a6e66245efedbd6c070f9c0aee55 Author: Eugene Grosbein AuthorDate: 2021-05-19 13:02:31 +0000 Commit: Eugene Grosbein CommitDate: 2021-05-19 13:02:31 +0000 rc.d: unbreak sysctl lastload /etc/rc.d/securelevel is supposed to run /etc/rc.d/sysctl lastload late at boot time to apply /etc/sysctl.conf settings that fail to apply early. However, this does not work in default configuration because of kern_securelevel_enable="NO" by default. Add new script /etc/rc.d/sysctl lastload that starts unconditionally. Reported by: Marek Zarychta MFC after: 1 month --- libexec/rc/rc.d/securelevel | 6 +----- libexec/rc/rc.d/sysctl_lastload | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.d/securelevel b/libexec/rc/rc.d/securelevel index 24dbf269df3f..8bb09dd920bd 100755 --- a/libexec/rc/rc.d/securelevel +++ b/libexec/rc/rc.d/securelevel @@ -4,7 +4,7 @@ # # PROVIDE: securelevel -# REQUIRE: adjkerntz ipfw pf +# REQUIRE: adjkerntz ipfw pf sysctl_lastload . /etc/rc.subr @@ -14,10 +14,6 @@ rcvar='kern_securelevel_enable' start_cmd="securelevel_start" stop_cmd=":" -# Last chance to set sysctl variables that failed the first time. -# -/etc/rc.d/sysctl lastload - securelevel_start() { if [ ${kern_securelevel} -ge 0 ]; then diff --git a/libexec/rc/rc.d/sysctl_lastload b/libexec/rc/rc.d/sysctl_lastload new file mode 100755 index 000000000000..22aafd96d051 --- /dev/null +++ b/libexec/rc/rc.d/sysctl_lastload @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sysctl_lastload +# REQUIRE: LOGIN +# BEFORE: jail + +. /etc/rc.subr + +name="sysctl_lastload" +desc="Last chance to set sysctl variables that failed the first time." +start_cmd="/etc/rc.d/sysctl lastload" +stop_cmd=":" + +load_rc_config $name +run_rc_command "$1"