History log of /src/libexec/rc/debug.sh (Results 1 – 20 of 20)
Revision Date Author Comments
# d7922c3d 10-Feb-2026 Kalevi Kolttonen <kalevi@kolttonen.fi>

Fix debug.sh comment typo

Signed-off-by: Kalevi Kolttonen <kalevi@kolttonen.fi>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2012


# ab835b37 23-Feb-2026 Artem Bunichev <tembun@bk.ru>

debug.sh: Fix a typo

MFC after: 3 days
Reviewed by: emaste, guest-seuros, sjg, ziaee
Differential Revision: https://reviews.freebsd.org/D55416


# 5c4d1c85 07-Aug-2025 Simon J. Gerraty <sjg@FreeBSD.org>

Replace license with just SPDX BSD-2-Clause


# 203027b2 31-Dec-2024 Simon J. Gerraty <sjg@FreeBSD.org>

Update libexec/rc/debug.sh and hooks.sh

Use local_works() to test if 'local' actually works for
current shell.


# a4e7810f 04-Nov-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during boot.

Reviewed by: stevek

show more ...


# 02653835 22-Oct-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we are already debugging.

show more ...


# 7e1c014a 10-Sep-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and hence immutable
scripts.

Like debug.sh, hooks.sh is extremely handy and used extensively
in many parts of Junos and its build environment.
It is provided here in the hope that others may benefit.

We do not dot hooks.sh by default to reduce overhead, but it can
but done from rc.conf et al using

$_HOOKS_SH . /libexec/hooks.sh

to avoid including more than once.

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D46552

show more ...


# aa3b7a2f 09-Feb-2024 Simon J. Gerraty <sjg@FreeBSD.org>

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate fra

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate framework for debugging shell scripts.

For secure systems, we want to be paranoid about what we read
during boot.

dot() simply reads (.) arg file if it exists
vdot() if mac_veriexec is active, ignore unverified files
otherwise behaves much the same as dot()
safe_dot() in safe_eval.sh allows reading an untrusted file;
limiting the input to simple variable assignments.

In load_rc_config allow caller to provide an option to indicate how to
handle its arg:
-v use vdot()
-s use sdot() which will try to use vdot() and fallback to safe_dot()
The default is to read using dot()

rc_run_scripts()
encapsulate the running of rc.d scripts
so that we can easily call it more than twice.

We vdot local.rc.subr to pick up extensions (like
run_rc_scripts_final) and overrides.

We also allow rc.subr.local or rc.conf to set rc_config_xtra
eg (rc_config_xtra=XXX for historic compatibility)

rc use set -o verify around the reading in of rc.subr
This has no effect if mac_veriexec is not active, but if it is; ensures
rc.subr has not been tampered with.

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D43671

show more ...


# 5c4d1c85 07-Aug-2025 Simon J. Gerraty <sjg@FreeBSD.org>

Replace license with just SPDX BSD-2-Clause


# 203027b2 31-Dec-2024 Simon J. Gerraty <sjg@FreeBSD.org>

Update libexec/rc/debug.sh and hooks.sh

Use local_works() to test if 'local' actually works for
current shell.


# a4e7810f 04-Nov-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during boot.

Reviewed by: stevek

show more ...


# 02653835 22-Oct-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we are already debugging.

show more ...


# 7e1c014a 10-Sep-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and hence immutable
scripts.

Like debug.sh, hooks.sh is extremely handy and used extensively
in many parts of Junos and its build environment.
It is provided here in the hope that others may benefit.

We do not dot hooks.sh by default to reduce overhead, but it can
but done from rc.conf et al using

$_HOOKS_SH . /libexec/hooks.sh

to avoid including more than once.

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D46552

show more ...


# aa3b7a2f 09-Feb-2024 Simon J. Gerraty <sjg@FreeBSD.org>

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate fra

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate framework for debugging shell scripts.

For secure systems, we want to be paranoid about what we read
during boot.

dot() simply reads (.) arg file if it exists
vdot() if mac_veriexec is active, ignore unverified files
otherwise behaves much the same as dot()
safe_dot() in safe_eval.sh allows reading an untrusted file;
limiting the input to simple variable assignments.

In load_rc_config allow caller to provide an option to indicate how to
handle its arg:
-v use vdot()
-s use sdot() which will try to use vdot() and fallback to safe_dot()
The default is to read using dot()

rc_run_scripts()
encapsulate the running of rc.d scripts
so that we can easily call it more than twice.

We vdot local.rc.subr to pick up extensions (like
run_rc_scripts_final) and overrides.

We also allow rc.subr.local or rc.conf to set rc_config_xtra
eg (rc_config_xtra=XXX for historic compatibility)

rc use set -o verify around the reading in of rc.subr
This has no effect if mac_veriexec is not active, but if it is; ensures
rc.subr has not been tampered with.

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D43671

show more ...


# 5c4d1c85 07-Aug-2025 Simon J. Gerraty <sjg@FreeBSD.org>

Replace license with just SPDX BSD-2-Clause


# 203027b2 31-Dec-2024 Simon J. Gerraty <sjg@FreeBSD.org>

Update libexec/rc/debug.sh and hooks.sh

Use local_works() to test if 'local' actually works for
current shell.


# a4e7810f 04-Nov-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during

debug.sh check for :debug_add:

When we match a tag and turn tracing, see if we have any
$DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag.

This allows for more focused debugging during boot.

Reviewed by: stevek

show more ...


# 02653835 22-Oct-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we

debug.sh add DebugAdd

Sometimes it is desirable while debugging one script for it to enable
debugging of a child.
We can do that with

$DEBUG_DO DebugAdd tag

to add tag to DEBUG_SH but only when we are already debugging.

show more ...


# 7e1c014a 10-Sep-2024 Simon J. Gerraty <sjg@FreeBSD.org>

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and

debug.sh take advantage of hooks.sh

Allow Debug{On,Off} to run associated hooks.
This makes it feasible to collect extra debug info at runtime
without needing to modify any potentially verified and hence immutable
scripts.

Like debug.sh, hooks.sh is extremely handy and used extensively
in many parts of Junos and its build environment.
It is provided here in the hope that others may benefit.

We do not dot hooks.sh by default to reduce overhead, but it can
but done from rc.conf et al using

$_HOOKS_SH . /libexec/hooks.sh

to avoid including more than once.

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D46552

show more ...


# aa3b7a2f 09-Feb-2024 Simon J. Gerraty <sjg@FreeBSD.org>

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate fra

/etc/rc add trace debug and verify

Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate framework for debugging shell scripts.

For secure systems, we want to be paranoid about what we read
during boot.

dot() simply reads (.) arg file if it exists
vdot() if mac_veriexec is active, ignore unverified files
otherwise behaves much the same as dot()
safe_dot() in safe_eval.sh allows reading an untrusted file;
limiting the input to simple variable assignments.

In load_rc_config allow caller to provide an option to indicate how to
handle its arg:
-v use vdot()
-s use sdot() which will try to use vdot() and fallback to safe_dot()
The default is to read using dot()

rc_run_scripts()
encapsulate the running of rc.d scripts
so that we can easily call it more than twice.

We vdot local.rc.subr to pick up extensions (like
run_rc_scripts_final) and overrides.

We also allow rc.subr.local or rc.conf to set rc_config_xtra
eg (rc_config_xtra=XXX for historic compatibility)

rc use set -o verify around the reading in of rc.subr
This has no effect if mac_veriexec is not active, but if it is; ensures
rc.subr has not been tampered with.

Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D43671

show more ...