Date: Tue, 6 Mar 2007 18:46:26 -0500 From: Jerry McAllister <jerrymc@msu.edu> To: Drew Jenkins <drewjenkinsjr@yahoo.com> Cc: freebsd-questions@freebsd.org Subject: Re: Setting Env Message-ID: <20070306234626.GA11995@gizmo.acns.msu.edu> In-Reply-To: <490012.3649.qm@web62204.mail.re1.yahoo.com> References: <490012.3649.qm@web62204.mail.re1.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 06, 2007 at 03:37:23PM -0800, Drew Jenkins wrote: > Don Hinton wrote: > > ># ldconfig -aout -f /etc/ld.so.conf /usr/local/lib/mysql/ > > > >will create it for you. man ldconfig for more info... > > Well, that created a binary, but when I rebooted...nothing. Same problem :( > > ----- Original Message ---- > From: Jerry McAllister <jerrymc@msu.edu> > To: Drew Jenkins <drewjenkinsjr@yahoo.com> > Cc: freebsd-questions@freebsd.org > Sent: Tuesday, March 6, 2007 6:31:34 PM > Subject: Re: Setting Env > > >I don't know for sure what you mean That's not an option. Is this > >running from cron or at system bootup or something so there is no login > >involved? > > Correct > > >In those cases, it is well documented that your scripts have to be > >completely responsible for their environments and paths, etc. So, > >set everything within the scipt. Or, if it is something systemwide, > >then put setting the variable it in /etc/rc.conf or /etc/rc.conf.local if > >you let your system have one. > > Exactly. But how? I could write a script like I did before: Well, either put setting the environment variable in rc.conf - then it will be readable by everyone or put it is the script that needs the variable to be set. > > #!/bin/csh > setenv LD_LIBRARY_PATH /usr/local/lib/mysql/ > > (chmod +x) but that didn't execute, dunno why. But then how do I call > that script? What shell does /etc/rc.conf use? What failed in the script? are those two lines the only ones that were in the script? If so, the script does nothing. It sets the variable only for things from within the script. The script is a shell. I suppose you could source it, but that stil takes a command. 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. ////jerry > TIA, > Drew > > > > > > > > ____________________________________________________________________________________ > We won't tell. Get more on shows you hate to love > (and love to hate): Yahoo! TV's Guilty Pleasures list. > http://tv.yahoo.com/collections/265 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070306234626.GA11995>