History log of /freebsd/share/man/man8/rc.subr.8 (Results 1 – 25 of 96)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# a5ad360f 23-Oct-2024 Mateusz Piotrowski <0mp@FreeBSD.org>

rc: Remove rc_fast_and_loose

The rc_fast_and_loose variable allowed rc(8) to start services
by sourcing them into rc's own shell environment. Normally, each rc
service script is started by being sou

rc: Remove rc_fast_and_loose

The rc_fast_and_loose variable allowed rc(8) to start services
by sourcing them into rc's own shell environment. Normally, each rc
service script is started by being sourced into its own subshell
instead. The feature was meant to speed up rc(8) by avoiding the extra
forking necessary to spawn subshells.

In practice, the feature has been broken for a long time now. One of the
reasons is that some rc service scripts call the exit builtin to return
non-zero error codes, which not only terminates the service subshell
but also rc(8) when rc_fast_and_loose is enabled. For example,
a system running any of the supported FreeBSD releases
with rc_fast_and_loose=yes would abort rc(8) as early as rc.d/hostid,
due to an "exit 0".

Fixing rc_fast_and_loose support would require rewriting some rc scripts
to support being sourced directly into rc(8) process. This would muddy
the code base and also would prove difficult to maintain long term
as this is simply not how rc(8) users write scripts. The potential
performance benefits are unlikely to be significant even for use cases
such as Morello under qemu.

Instead, remove support for rc_fast_and_loose completely from rc(8)
and inform users about the change.

PR: 282255
Reviewed by: brooks, christos, mhorne
Approved by: christos (mentor), markj (mentor)
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D47264

show more ...


# 6e1fc011 15-Oct-2024 Graham Percival <gperciva@tarsnap.com>

manuals: Fix "unusual .Xr" warnings with a script

These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tar

manuals: Fix "unusual .Xr" warnings with a script

These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1464

show more ...


# 8b92fa1c 07-Oct-2024 Graham Percival <gperciva@tarsnap.com>

manuals: Misc syntax fixes

These were reported by `mandoc -T lint ...` as errors.

Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap B

manuals: Misc syntax fixes

These were reported by `mandoc -T lint ...` as errors.

Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1453

show more ...


# 6e414739 22-Sep-2024 Mateusz Piotrowski <0mp@FreeBSD.org>

rc.subr.8: Fix the Bl macro of a list which is actually a table

MFC after: 2 weeks


# 85986815 22-Sep-2024 Mateusz Piotrowski <0mp@FreeBSD.org>

rc.subr.8: Do not use mdoc macros for Bl width

Macros do not expand there.

MFC after: 1 week


Revision tags: release/13.4.0
# af1b0aa5 18-Jun-2024 Eugene Grosbein <eugen@FreeBSD.org>

rc.subr: improve description for ${name}_offcmd

Clarify that ${name}_offcmd is for method start.

MFC after: 3 days


# 32a579e4 02-Jun-2024 Eugene Grosbein <eugen@FreeBSD.org>

rc.subr(8): introduce ${name}_offcmd

New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but no

rc.subr(8): introduce ${name}_offcmd

New variable ${name}_offcmd may be used to supply commands
executed if named service is not enabled. Previously start_precmd
could be used for such a task but now rc.subr(8) does not call it
if a service is not enabled.

Fix devd startup script to use it instead of start_precmd.

PR: 279198
MFC after: 2 weeks
Reported by: Dmitry S. Lukhtionov
Tested by: Dmitry S. Lukhtionov

show more ...


Revision tags: release/14.1.0
# 11333dd5 24-May-2024 Franco Fichtner <franco@opnsense.org>

rc: improve NAME_setup handling

Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd

rc: improve NAME_setup handling

Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx). In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one. Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

Differential-Revsiion: https://reviews.freebsd.org/D36259
Signed-off-by: Franco Fichtner <franco@opnsense.org>
Reviewed by: imp, oshogbo
Pull Request: https://github.com/freebsd/freebsd-src/pull/1258

show more ...


Revision tags: release/13.3.0
# 41f9823e 10-Feb-2024 Simon J. Gerraty <sjg@FreeBSD.org>

rc.subr.8 note when DebugOn will be called


# 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 ...


Revision tags: release/14.0.0
# fa9896e0 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0
# b05e7e70 11-Nov-2022 Franco Fichtner <franco@opnsense.org>

rc: add a manual entry for ${name}_setup

${name}_prepend is suboptimal as it is prepended to the actual
command being run. Therefore the term "commandS to prepend"
is misleading and no clear separat

rc: add a manual entry for ${name}_setup

${name}_prepend is suboptimal as it is prepended to the actual
command being run. Therefore the term "commandS to prepend"
is misleading and no clear separation takes place for setup tasks
that may be required like changing a config file permission or
generating a configuration file prior to service start.

The other reason is that {argument}_precmd is a service-side
variable and cannot be repurposed from the user-side.

Reviewed by: pauamma
Differential Revision: https://reviews.freebsd.org/D36210

show more ...


Revision tags: release/13.1.0
# fa1dab78 18-Mar-2022 Mateusz Piotrowski <0mp@FreeBSD.org>

rc.subr.8: Format notes consistently

MFC after: 3 days


# 325ebf37 13-Mar-2022 Jose Luis Duran <jlduran@gmail.com>

Introduce startmsg and use it in rc scripts

startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten

check_startmsgs

Introduce startmsg and use it in rc scripts

startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten

check_startmsgs && echo ...

with

startmsg ...

No functional change intended.

I adjusted the commit message and did some final clean-ups of the patch
before committing.

PR: 255207
Reported by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp, 0mp
Approved by: imp (src)
Differential Revision: https://reviews.freebsd.org/D34514

show more ...


Revision tags: release/12.3.0
# 5d21348d 29-Nov-2021 Mateusz Piotrowski <0mp@FreeBSD.org>

rc.subr.8: Document changes to load_rc_config

Since e27961a496322e2590da29f3c5fe710b269e6754, load_rc_config does not
require a service name as its first argument. This change was documented
in the

rc.subr.8: Document changes to load_rc_config

Since e27961a496322e2590da29f3c5fe710b269e6754, load_rc_config does not
require a service name as its first argument. This change was documented
in the rc.subr script in 0b9c2e7ac58caac0413aa36749e4c212514d142d. Let's
update the manual page as well.

MFC after: 3 days

show more ...


Revision tags: release/13.0.0, release/12.2.0
# c7aa572c 31-Jul-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# 17996960 31-Jul-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r363583 through r363738.


# 0b87619f 31-Jul-2020 Mateusz Piotrowski <0mp@FreeBSD.org>

Point to rc(8) for more details about the autoboot variable

Reviewed by: bcr, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25904


# d6dade00 24-Jul-2020 Mateusz Piotrowski <0mp@FreeBSD.org>

Fix grammar issues and typos

Reported by: ian
MFC after: 1 week


# 5ccb7079 24-Jul-2020 Mateusz Piotrowski <0mp@FreeBSD.org>

Document that force_depend() supports only /etc/rc.d scripts

Currently, force_depend() from rc.subr(8) does not support depending on
scripts outside of /etc/rc.d (like /usr/local/etc/rc.d). The /etc

Document that force_depend() supports only /etc/rc.d scripts

Currently, force_depend() from rc.subr(8) does not support depending on
scripts outside of /etc/rc.d (like /usr/local/etc/rc.d). The /etc/rc.d path
is hard-coded into force_depend().

MFC after: 1 week

show more ...


Revision tags: release/11.4.0, release/12.1.0
# f993ed2f 09-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r351732 through r352104.


# d15e810d 05-Sep-2019 Mateusz Piotrowski <0mp@FreeBSD.org>

rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd)

A user may set ${name}_env variable in rc.conf(5) in order to set additional
environment variables for a service command. Unfo

rc: Honor ${name}_env when a custom *_cmd is defined (e.g., start_cmd)

A user may set ${name}_env variable in rc.conf(5) in order to set additional
environment variables for a service command. Unfortunately, at the moment
this variable is only honored when the command is specified via the command
variable. Those additional environment variables coming from ${name}_env
are never set if the service is started via the ${rc_arg}_cmd variable (for
example start_cmd).

PR: 239692
Reviewed by: bcr, jilles
Approved by: src (jilles)
Differential Revision: https://reviews.freebsd.org/D21228

show more ...


Revision tags: release/11.3.0
# ac102a2a 05-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

rc.subr: Provide rc_service variable for service scripts

Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for
'application profiles' that usually require the rc script to be invoked
agai

rc.subr: Provide rc_service variable for service scripts

Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for
'application profiles' that usually require the rc script to be invoked
again for each active profile. Because there's no consistent way to
determine the path because it differs between manual/service(8) invocations
and /etc/rc invocations, this leads to patterns like these:

- www/uwsgi hardcodes the script path
- security/openvpn guesses either $_file or $0 based on $0 = /etc/rc

Instead of forcing rc scripts to guess, provide an rc_service variable to
the scripts that gets set appropriately both for direct execution or when a
script is being executed via run_rc_script (e.g. /etc/rc).

This is our analog of an OpenRC variable with the same name, different case
(RC_SERVICE).

PR: 234614
Reported by: koobs
Reviewed by: dteske, jilles
MFC after: 3 days

show more ...


Revision tags: release/12.0.0
# 8c153822 07-Nov-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r340213 through r340234.


# fda4dad5 07-Nov-2018 Mateusz Piotrowski <0mp@FreeBSD.org>

rc.subr(8): Document when required_* variables are processed

At the moment rc.subr(8) supports the following required_* variables:
required_dirs, required_files, required_modules and required_vars.

rc.subr(8): Document when required_* variables are processed

At the moment rc.subr(8) supports the following required_* variables:
required_dirs, required_files, required_modules and required_vars.

This patch documents when every of those required_* variables is actually
processed (before or after running start_precmd).

Reviewed by: bcr
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17895

show more ...


1234