From nobody Sat Aug 03 17:57:22 2024 X-Original-To: dev-commits-src-all@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 4Wbr4z19sMz5Sp7Y; Sat, 03 Aug 2024 17:57:23 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbr4z0fynz4hf8; Sat, 3 Aug 2024 17:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722707843; 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=x04d5fj1f5BfXqHhEldBiz3qbsHv9kOM5xWPRYx6F9g=; b=uilYOg4Bi2mLHyJbVyd/uzOr1WgcKLjoJ6/hvc304kdsl1dCP+WGhfjfwIG6a1kW+RhORs I3b2Umyu/hYWqoPigvU5+tsSLyjF4thaCBcR8fi5BRWuj4qZulKHxHFQIWDYAyqK9IQUDF BSLRidNjwqLYoLtOOpvMizS4PI/CRi1ylcSDXJZ5Kp6KXZzMAgcUvF3G9we5SC+4wwkdu/ OwwPoyvTvwweW6x2eGquB9ZZr4ByIvSd7DPLuyRBKC05NlcTMwsl3L1WFHKRA65zdYt7pH 1r2HUw8dl+mFlvoRdT7IMNpyqy1dq/xmSdKn02N/VTZoo5fUbu9gfgim70TUuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722707843; a=rsa-sha256; cv=none; b=f3V45xwNabz9f9rT7QuK2SIMGPuD1zpSi8It9hTicmvEAKaCoBKOVcsWCLyWkWANiBAu/9 9kFCSk8IO74+oyP7U2vPSPObY0uN4a0JxuU/09oD4KrCHlSfV4kH3/6OhHm1hnHmyfuQyo nWyuI6u1KPjjcZ/MO4G/ZirgeiNQ+4D6V9UV23nZ3nybv6LnuBgbUo2uJb0dUNaGSmEOL7 yE4KEfFnTM9YQTowxwlkOpOTZGq7AE85Sf9opRAr7/Kp9PP4t1SF8ex0Ipx/LKnC3qJ4OF x7dMX4KI7HPrQQzopUCWN7RiJ+8qTn/+gVp8Vnn0vgnkexfFimtilEdYwCoMpA== 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=1722707843; 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=x04d5fj1f5BfXqHhEldBiz3qbsHv9kOM5xWPRYx6F9g=; b=hel3iCSkgXR2UYCRpzwA3h2VaCbI21E25kBHUDFk0pPYKJAQKTSKTXQB9kTOombHYzDHcg bVC1gZ/YMdz4PG1o26s/uoJUAomFvKNhImYLJSyJp33KZUFXAQ4odceT5DpYEUA84bh8Hu r3D9D/49vsU5mXnI+zeVthI4kTfn2Fp5rJ0fjEGS19X+geiaNqAQuMimmx39teMaSenphA yPqHkKdaScB8Ib0SH23/lEE+dwd/t/i1+3dTz7L26ohch/4Q9zfwF2VzLXY4ZsDRFkuDI0 CKggHzNeUrDmcZbGj7x/Xs3+9qV3qKlj9pmc1zMPxAyE02Oxs8yNz1bqB3eDbg== 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 4Wbr4z017fzLmG; Sat, 3 Aug 2024 17:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 473HvMT5064201; Sat, 3 Aug 2024 17:57:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473HvM9S064198; Sat, 3 Aug 2024 17:57:22 GMT (envelope-from git) Date: Sat, 3 Aug 2024 17:57:22 GMT Message-Id: <202408031757.473HvM9S064198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 6502c60c2281 - main - Move fetch of DEBUG_SH from kenv to rc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6502c60c22819b879542c423cb7393d448d00e59 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6502c60c22819b879542c423cb7393d448d00e59 commit 6502c60c22819b879542c423cb7393d448d00e59 Author: Simon J. Gerraty AuthorDate: 2024-08-03 17:56:48 +0000 Commit: Simon J. Gerraty CommitDate: 2024-08-03 17:56:48 +0000 Move fetch of DEBUG_SH from kenv to rc We only need to check kenv for DEBUG_SH once. We also need to export DEBUG_SH to be useful. Sponsored by: Juniper Networks, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46219 --- libexec/rc/rc | 5 +++++ libexec/rc/rc.subr | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index b23b0f35f263..5ed47d6eac20 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -72,6 +72,11 @@ set -o verify set +o verify load_rc_config $rc_config_xtra +if have DebugOn; then + # allow DEBUG_SH to be set from loader prompt + export DEBUG_SH=${DEBUG_SH:-$(kenv -q DEBUG_SH)} +fi + # If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d # scripts to perform "boot-time configuration" including enabling and # disabling rc.d scripts which appear later in the boot order. diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index f1f6cf6c8c2a..145b626aa01e 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -2767,10 +2767,7 @@ $_DEBUG_SH vdot /libexec/debug.sh # Ensure we can still operate if debug.sh and # safe_eval.sh are not found. -if have DebugOn; then - # allow DEBUG_SH to be set from loader prompt - DEBUG_SH=${DEBUG_SH:-$(kenv -q DEBUG_SH)} -else +if ! have DebugOn; then DebugOn() { return 0; } DebugOff() { return 0; } fi