Setting an environment var at boot
RW
fbsd06 at mlists.homeunix.com
Wed Sep 3 12:30:38 UTC 2008
On Wed, 3 Sep 2008 11:28:14 +0200
Polytropon <freebsd at edvax.de> wrote:
> On Wed, 3 Sep 2008 10:49:25 +0200, Nicolas Letellier
> <nicolas at nicoelro.net> wrote:
> > What file do you advice?
>
> Unclean, but maybe "early" enough in the boot process: /etc/rc.local.
> This file won't be touched at port's or system's update.
I don't think that would work, since rc.local is sourced from a
subshell.
> Much more unclean, but certainly earlier: /etc/rc itself. Thile file
> is examined during system update.
>
>
I've not tried it myself, but I think you could probably just export the
variable in rc.conf (provided that the value isn't required in the rc.d
script itself, for initialization, before run_rc_command is executed).
You can also put per script configuration in the file
/etc/rc.conf.d/<name>
where <name> is whatever the rc.d script sets as "name".
More information about the freebsd-questions
mailing list