Date: Thu, 8 Mar 2007 09:55:50 -0800 (PST) From: Drew Jenkins <drewjenkinsjr@yahoo.com> To: freebsd-questions@freebsd.org Subject: Re: Setting Env Message-ID: <390266.64333.qm@web62207.mail.re1.yahoo.com>
next in thread | raw e-mail | index | archive | help
On Thu, Mar 08, 2007 at 08:31:23AM -0800, Drew Jenkins wrote:=0A=0A> Anyway= , I suggest first just working on getting any script to run=0A> at boot tim= e - or rather at the time the system comes up for multi-=0A> user, but that= stuff does not run when it comes up to single-user.=0A> =0A> So, my next s= uggestion is to make any little ole script with a couple=0A> of echo-s in i= t to demonstration that it runs and put that it=0A> the /usr/local/etc/rc.d= directory with the correct permissions=0A> and name, etc. NOTE, someone = in an earlier post clarified the .sh=0A> issue with information that was ne= w to me about the system looking=0A> for certain flags inside the file if t= he file name does not have=0A> the .sh ending. Go back and check that out= , but the this, assume=0A> you have to have .sh and execute permission.=0A>= =0A> You do not have to have a start/stop/restart check in the script if= =0A> the script will always just run regardless of parameter. But,=0A> wh= at the system does is call the script with a parameter of 'start'=0A> at bo= ot time and a parameter of 'stop' at shutdown time.=0A> =0A> But for the sa= ke of the primative test, those can be omitted.=0A> =0A> Let's say you call= the scriptfile: 'rctest.sh'=0A> Put something like:=0A> =0A> #!/bin/sh=0A>= echo "running rctest.sh, got this far"=0A> =0A> # Add any any other stuff = you want to test=0A> =0A> echo "running rctest.sh, finished"=0A> =0A> =0A> = Now, if the bare skeleton works, then start adding more parts=0A> to it unt= il you get to where everything works. Add more echo-s=0A> if they are use= ful.=0A=0ABut I've done that (except name it *.sh, which I just did). And I= 'm not at the server. It's on the other side of the globe. So I can't watch= echo's pop up as it boots. Here's my script:=0A=0A#!/bin/sh=0A=0Asleep 60= =0Aif [ -n "$LD_LIBRARY_PATH" ] ; then=0A export LD_LIBRARY_PATH=3D"${LD= _LIBRARY_PATH}:/usr/local/lib/mysql"=0Aelse=0A export LD_LIBRARY_PATH=3D= "/usr/local/lib/mysql"=0Afi=0A=0Acd /usr/local/zope/=0A./instance1/bin/zope= ctl stop=0A./instance1/bin/zopectl start=0A./instance2/bin/zopectl stop=0A.= /instance2/bin/zopectl start=0A=0AThe sleep is in there to try to get it to= run after everything else has come up, but it doesn't help. If I run that = script after boot, everything works out fine.=0A=0A> You could also look up= how to get your messages written to a log=0A=0AHey, now there's an idea! H= ow do I do that? Or where do I go to study how to do that?=0ATIA,=0ADrew=0A= =0A=0A=0A=0A=0A =0A________________________________________________________= ____________________________=0ABored stiff? Loosen up... =0ADownload and pl= ay hundreds of games for free on Yahoo! Games.=0Ahttp://games.yahoo.com/gam= es/front
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?390266.64333.qm>