Commit Graph

31 Commits

Author SHA1 Message Date
wiz d8b2f12e48 Bump date for previous and remove trailing whitespace. 2012-12-18 13:14:34 +00:00
apb 532fa0d9ae Add shell implementations of basename and dirname to rc.subr. They
are supposed to mimic basename(1) and dirname(1), except that they
are usable before /usr/bin is mounted.
2012-12-17 18:17:27 +00:00
apb 7535058544 Allow "echo -n" to work as expected in rc.d scripts that are executed
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.
2011-08-11 22:52:46 +00:00
apb 71e8773dba Bump date for previous 2010-09-26 18:52:52 +00:00
apb f265a7c0e8 Add a collapse_backslash_newline function to rc.subr. 2010-09-26 18:37:14 +00:00
jmmv f54900017c Document that run_rc_command can take extra parameters and will pass those
to the command being executed.
2010-03-15 19:00:20 +00:00
apb 7222c07e1c Typo in macro name (.Is -> .Ic), noticed by joerg@ 2009-10-05 09:57:18 +00:00
wiz 0b645b22fc Bump date for previous. Whitespace nit. Use Nm instead of Xr to itself. 2009-09-11 19:48:52 +00:00
apb 89fd535731 Add a postprocessor to /etc/rc, which logs messages to /var/run/rc.log,
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.
2009-09-11 18:17:04 +00:00
joerg e597a0f468 Don't use .Xo/.Xc to workaround argument limit in ancient groff. 2009-04-09 04:01:06 +00:00
wiz 839eeade42 Bump date for previous. 2008-05-25 09:07:21 +00:00
he 0bf7256056 Document the new ${name}_env feature: list of new or modified environment
variables to set when starting ${command}.
2008-05-24 19:57:21 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
apb 31edfc6f0f * Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process.  The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
  replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
2007-04-06 14:20:08 +00:00
lukem 3c81b28a9a * Implement
load_rc_config_var cmd var
  to load the rc.conf(5) configuration for cmd and set var in the
  current shell, using 'load_rc_config var' in a sub-shell to avoid
  unwanted side-effects.

* Improve required_vars warning message.
2004-10-12 14:45:29 +00:00
gendalia ed8de01a24 Flasg -> Flags 2004-04-29 22:44:43 +00:00
wiz 1913c0ff53 Simplify sentence. 2004-04-02 13:23:07 +00:00
jmmv 3c8a1444d9 Introduce and use the rcvar_manpage variable, which contains the manual page
name where the user should look at for documentation about rcvar.  It defaults
to 'rc.subr(5)', as rc.subr is mainly used by rc.d scripts.

This variable is useful to let the daily, weekly, monthly and security scripts
tune the warning message shown when any of the variables they handle is not
properly set.

Closes PR misc/23908.
2004-04-02 13:13:47 +00:00
lukem f3bab2a8fc Implement ``one'' prefix to allow a "one shot" operation as if
${rcvar}=yes yet all the other prerequisite tests are still performed.
The existing ``force'' prefix is a sledgehammer that ignores all the
prerequisite checks and always returns a zero exit status; this is a
more gentle approach to the problem of "manipulate this disabled
service without editing rc.conf(5)".
2004-01-06 00:52:24 +00:00
jmmv 4296d7d483 Drop trailing whitespace. Reviewed by wiz. 2003-05-06 10:46:41 +00:00
wiz 45ad5c9584 successful with only one l. 2003-01-06 12:46:05 +00:00
atatat 28d021bcf5 Add systrace(1) support to rc.subr. Most services (eg, ${name} is
inetd) started from rc can now be run under systrace by setting
${name}_systrace to a set of flags to be passed to systrace.  Note
that policies need to generated before you do this.
2002-07-08 16:14:55 +00:00
lukem 0e798bbe1e minor improvements, including consistency in how variables are formatted. 2002-04-18 11:14:33 +00:00
lukem 5ee7ac8886 Replace $critical_filesystems_beforenet with $critical_filesystems_local .
Replace  $critical_filesystems            with  $critical_filesystems_remote .

The new names are now consistent with the type argument that
mount_critical_filesystems() is called with, and allows for other types to
be easily supported by that function.

For backwards compatibility purposes, if the now obsolete variable is defined
(even empty), it takes precedence over the new form, and you will be warned.
If you want to stop the warnings, update your rc.conf(5) settings!
2002-03-27 08:53:39 +00:00
lukem ee821504dd - document optional "interpreter" argument to check_pidfile() and
check_process()
- document rc_* variables available in method and after run_rc_command()
  completes
2002-03-24 15:32:59 +00:00
lukem b8bcb6125d document $command_interpreter 2002-03-21 12:29:18 +00:00
lukem ce3cfa06ae document ${_arg}_postcmd 2002-03-13 04:57:11 +00:00
wiz c38591ca4c Punctuation nits. 2002-02-25 13:16:45 +00:00
lukem 80ce7c6cb7 Fixes derived from [bin/15563] submitted by Ron Roskens:
- Don't su(1) to ${name}_user if running as that user.
- Support $procname as the name of the process to search for.
  Defaults to the value of $command.
2002-02-25 12:49:33 +00:00
lukem 868c9ba182 rc.subr(8) - functions used by system shell scripts. Closes PR [misc/10828]. 2002-02-25 12:05:13 +00:00