seconds, detach from the controlling terminal. Without this, pressing
control-T (to send SIGINFO from the terminal) would almost always result
in the sleep process printing "about N seconds left of the original 3",
which is useless information.
inline tests like [ -n "${_rc_postprocessor_fd}" ]. The new function
performs a few new tests, including verifying that /etc/rc is still
running (using a new _rc_pid variable set by /etc/rc).
This is intended to deal with the case that a script run from /etc/rc
spawns a background process, then /etc/rc exits, but the background
process still has environment variables inherited from /etc/rc.
Fixes PR 46546.
by /etc/rc. Similarly for printf with a format that does not end with
"\n". Previously, the partial line would not be visible on the console
until a newline was printed, possibly after an annoying delay.
This is done by adding echo() and printf() shell functions to rc.subr,
so that naive use of the echo and printf commands in rc.d scripts will
call these functions instead of the underlying commands. These shell
functions send a new "nop" metadata message after the partial line, and
the rc_postprocess function in /etc/rc disentangles the partial line of
plain output from the metadata "nop".
Also add a "-n" option to the print_rc_normal function in rc.subr,
and make some cosmetic changes.
and which can suppress output in silent mode. Silent mode is enabled
via the new rc_silent variable, which defaults to a value that depends
on the kern.boothowto sysctl.
Part of the /etc/rc silent changes requested in PR 41946
and proposed in tech-userlevel.
rc_rcorder_flags extra flags to rcorder(8) in /etc/rc
rcshutdown_rcorder_flags extra flags to rcorder(8) in /etc/rc.shutdown
This can be used to specify extra directories to search for rc.d scripts in.
For example, adding the following to rc.conf(5):
rc_rcorder_flags="/usr/pkg/etc/rc.d/*"
rcshutdown_rcorder_flags="/usr/pkg/etc/rc.d/*"
will add the files in /usr/pkg/etc/rc.d to the list of files that rcorder(8)
uses to build the list of scripts to start or stop.
I proposed this functionality on tech-userlevel@ over one month ago.
Closes the recent [misc/16888], which asked for a similar feature.
make them "externally" available:
Previous Current Purpose
-------- ------- -------
_arg rc_arg Argument to command, after fast/force
processing performed (and prefix
removed)
_flags rc_flags Flags to start the default command
with. Defaults to ${name}_flags,
unless overridden by $flags from the
environment. This variable may be
changed by the precmd method.
_pid rc_pid PID of command (if appropriate).
_rc_run_fast rc_fast Not empty is "fast" was provided.
_rc_run_force rc_force Not empty is "force" was provided.
- Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts,
so that $flags from the environment overrides ${name}_flags from rc.conf(5).
Fixes [bin/15800].
- only load rc.conf if $_rc_conf_loaded is not set
- use case instead of if for various string comparisons
- print the date at the start of the boot as well as at the end
- if $rc_fast_and_loose is set, always run the rc.d scripts in the
current shell rather than in a subshell. this is not on by default
because it's potentially dangerous (a rogue command could terminate
the boot), but it is provided as an optional speedup for people
with slow machines that have an expensive fork
"fast" to the start of the run_rc_command arg.
/etc/rc calls each rc.d script with rc_fastboot=yes so that rc.subr
aware scripts to use "faststart" to skip the process running check.
merge in patches to implement multiple bootup configurations (look for
/etc/etc.current, /etc/etc.default and friends)
only start up NFS services if either nfs_client or nfs_server is yes.
kvm_mkdb so that when we boot we always have an upto-date kvm db, allowing
dmesg and friends to run without error when we do "boot netbsd.fun" to test
kernels, etc.
Stops a denial of service attack where the user can put a named pipe or
any other device that blocks i/o in /var/tmp/vi.recover/recover.*
[from dynamo@ime.net]
of "local" it will not mount filesystem types it identifies as
network file systems (currently just nfs). Call the function twice,
before networking starts with arg "local", after networking starts
with arg "network". Remove critfs_require_network as is now redundant.