Hiroki Sato 4a387a583b Resurrect set_rcvar() as a function to define a rc.conf variable.
It defines a variable and its default value in load_rc_config() just after
rc.conf is loaded.  "rcvar" command shows the current and the default values.

This is an attempt to solve a problem that rc.d scripts from third-party
software do not have entries in /etc/defaults/rc.conf.  The fact that
load_rc_config() reads rc.conf only once and /etc/rc invokes the function
before running rc.d scripts made developers confused for a long time because
load_rc_config() just before run_rc_command() in each rc.d script overrides
variables only when the script is directly invoked, not from /etc/rc.

Variables defined in set_rcvar are always set in load_rc_config() after
loading rc.conf.  An rc.d script can now be written in a self-contained
manner regarding the related variables as follows:

---
name=foo
rcvar=foo_enable

set_rcvar foo_enable	YES	"Enable $name"
set_rcvar foo_flags	"-s"	"Flags to $name"

...

load_rc_config $name
run_rc_command "$@"
---
2014-10-02 01:16:30 +00:00
..
2014-09-28 12:41:48 +00:00
2014-08-26 22:39:24 +00:00
2013-06-15 20:29:07 +00:00
2013-10-22 06:53:01 +00:00
2014-03-14 02:58:48 +00:00
2013-12-03 04:32:02 +00:00
rpc
2013-12-03 04:03:19 +00:00
2013-12-13 22:58:57 +00:00