Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Mar 2007 08:10:28 -0800
From:      Garrett Cooper <youshi10@u.washington.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Setting Env
Message-ID:  <45EEE3F4.8070408@u.washington.edu>
In-Reply-To: <20070307154059.GA14814@gizmo.acns.msu.edu>
References:  <812894.39097.qm@web62205.mail.re1.yahoo.com> <20070307154059.GA14814@gizmo.acns.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Jerry McAllister wrote:
> On Tue, Mar 06, 2007 at 04:28:39PM -0800, Drew Jenkins wrote:
> 
>> ----- Original Message ----
>> From: Jerry McAllister <jerrymc@msu.edu>
>> To: Drew Jenkins <drewjenkinsjr@yahoo.com>
>> Cc: freebsd-questions@freebsd.org
>> Sent: Tuesday, March 6, 2007 7:46:26 PM
>> Subject: Re: Setting Env
>>
>>> If you want the environment variable to
>>> be set for something that is taking place in the script, then
>>> that variable must either be set in a durable way in the parent
>>> environment or be set right there in the script that is using it.
>>> The rc.conf method will make it available from the parent.
>>> That is the whole point of rc.conf.
>> Right. I figured that much. So, what do I actually put in that file? I 
>> tried these two options:
>>
>> setenv LD_LIBRARY_PATH /usr/local/lib/mysql/
>>
>> export LD_LIBRARY_PATH="/usr/local/lib/mysql/"
>>
> 
> Well, setenv is a csh or tcsh command and isn't in sh and probably
> not in bash either (I haven't used bash).
> 
> The export command is an sh and probably bash command and it
> doesn't exist in csh or tcsh.
> 
> 
>> It didn't like either, presumably because it's not calling a bash or c-shell.
>> So, what should I put in /etc/rc.conf that will achieve my objective?
> 
> Look at other variable setting in rc.conf.  That should give you 
> a good clue.   For example, in my rc.conf I have several.  One is:
>   moused_enable="YES"
> That makes the moused_enable variable have a value of YES.
> So, if you want LD_LIBRARY_PATH to have the value of /usr/local/lib/mysql/
> might that not be:
>   LD_LIBRARY_PATH="/usr/local/lib/mysql/"
> 
> If you put it in the script that starts things - there needs to be one - 
> then it depends on the script language, csh/tcsh sh/bash.
> csh/tcsh use setenv and set
> sh [and bash] use set  and variable_name=value and needs an export to
> make it available to other entities besides the shell itself.
> You should look up the man pages on these things and take a look
> at some other scripts such as those in /usr/local/etc/rc.d for
> examples.
> 
> ////jerry
>> TIA,
>> Drew

Ok. Simplest way to solve this is to make your own run script and invoke 
it at boot. It's not that bad to do from what I understand..
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45EEE3F4.8070408>