From nobody Sun Jun 28 18:40:12 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gpJB44T4Gz6jkQ4 for ; Sun, 28 Jun 2026 18:40:12 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpJB43zxSz3XGy for ; Sun, 28 Jun 2026 18:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782672012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nLQnrUG9o/4tqqDtkE+L+ir6SrbiZa8LCrpXKOprAE=; b=r6kiOgrJsYSs1T2A6zguSJ9/ZmTu7Mm0QOdCcneTgrmq62+OXd+Evw6IM+zOE4l8EXNshV Huz63b93SQdsrOr01F1C1pDVGvpK+aQLaU8ArRYoO9oRbziQNp5k4klWv66AlvHAC0pWhg Wjm9vD6Ba5ghhkX9u5yaGhIPo2DMP/0fKnbbDVXo3H2/j0E7dLAYKCK3kx47NbPjvG+Jc/ sbbsVAVfDRWh6i+QoJm/pXzOn2aNEvwWa9ZZNboj6/j35lDOu9jH+BO07aTcl9JPgK6V9V uZdFX0KFnMWLgsuVQfR9lKLOBIs0QZaxsouRYK/9cClV35HqIFzXRsRBDOazdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782672012; a=rsa-sha256; cv=none; b=yR1pKt4wVVGSAp1GDjPiwtienoFzNZn5QluB+sbadfxy9WJrmpNUtFZbOCPqB+6uPMHMSK /EV/Esi3zqSCgqrgsweyKnti5ExWjtFQeIJ9wJXDWtzymrv2+JKFA9XE0uL3uPNkBdfDBo OxxSlILRAgtUgtX4t0VPN8/T8eSkJTs7gfPQB2yAQe71ZoZBbwLK+JToidULMtKlbJyz1V HffczoUj703z+sIGmYaTJJ5ki83pTH/bGBq+K6/EgjxEMy0x5kmY32GTGCxSfQ/pMzeiuY O0SWQcCDWkkJ5oOS57UkwZWp/EY8eyDjmTWz2QTJaZYxE0fQ3yi9Y3QYwgo24A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782672012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5nLQnrUG9o/4tqqDtkE+L+ir6SrbiZa8LCrpXKOprAE=; b=A+c1veiUwbsW/k43VpriQsRtI2eqqYmoRWrGEm2lLbMvCtYS2Al5K+RsYbwDYMPb56Y7pA mRzWwxNpRi9yMunr8mo9/N5qA6fUYnAMWcV/ryNhOiqBXJ0cgQAmOmRVeGDjsfz3dSySv/ AxDoiHb4EksucHREenOoWwZK98qyTb8TmChQdTyZnBilfyAKIZK2GBr8DvpOFHLWLRjyVw /5UeIHXhds8P2RMVDfGuUjOLSPlciTnIjhtYEbdQIpIhmBIsiIfW4F06SgbQd6DS5NFOdC 1XeBTXSosyOiPVR4esqQtSfSoRdutTx/b7IDd2woPtYmVkdTc2s16iTXPbZ2Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpJB4270jz75f for ; Sun, 28 Jun 2026 18:40:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1bcd6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 28 Jun 2026 18:40:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: bc3e0c6afdb9 - stable/15 - init: allow to specify a custom path for rc(8) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bc3e0c6afdb9adbe49f2efe8739580782bf6244b Auto-Submitted: auto-generated Date: Sun, 28 Jun 2026 18:40:12 +0000 Message-Id: <6a416a8c.1bcd6.421ed633@gitrepo.freebsd.org> The branch stable/15 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=bc3e0c6afdb9adbe49f2efe8739580782bf6244b commit bc3e0c6afdb9adbe49f2efe8739580782bf6244b Author: Baptiste Daroussin AuthorDate: 2026-05-05 12:00:41 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-28 18:32:23 +0000 init: allow to specify a custom path for rc(8) This is useful for testing alternative service managers without modifying /etc/rc MFC After: 1 weeks Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D56828 (cherry picked from commit 9f2ad7c09709e01ff6b856df0315e91ddc20df32) --- sbin/init/init.8 | 10 +++++++++- sbin/init/init.c | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sbin/init/init.8 b/sbin/init/init.8 index 85b1db2ddf06..f562efde0b51 100644 --- a/sbin/init/init.8 +++ b/sbin/init/init.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 22, 2021 +.Dd May 5, 2026 .Dt INIT 8 .Os .Sh NAME @@ -396,6 +396,14 @@ back to the default, so that the .Pa /etc/rc script is executed with the standard shell .Pa /bin/sh . +.It Va init_rc +If set to a valid file name in the root file system, +overrides the default path to +.Xr rc 8 +.Pq Pa /etc/rc . +This is useful for testing alternative service managers +without modifying the default +.Pa /etc/rc . .It Va init_path Specifies the path used to search for the init binary. More than one binary can be listed in the string, diff --git a/sbin/init/init.c b/sbin/init/init.c index d28501053c7f..db680c7f73bd 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1025,11 +1025,23 @@ static state_func_t runcom(void) { state_func_t next_transition; + char runcom_path[PATH_MAX]; + const char *rc_script; - BOOTTRACE("/etc/rc starting..."); - if ((next_transition = run_script(_PATH_RUNCOM)) != NULL) + /* + * Allow overriding /etc/rc via the init_rc kenv variable. + * This is useful for testing alternative service managers + * without modifying /etc/rc. + */ + if (kenv(KENV_GET, "init_rc", runcom_path, sizeof(runcom_path)) > 0) + rc_script = runcom_path; + else + rc_script = _PATH_RUNCOM; + + BOOTTRACE("%s starting...", rc_script); + if ((next_transition = run_script(rc_script)) != NULL) return next_transition; - BOOTTRACE("/etc/rc finished"); + BOOTTRACE("%s finished", rc_script); runcom_mode = AUTOBOOT; /* the default */ return (state_func_t) read_ttys;