[lug] Scripting something that relies on pwd

Atkinson, Chip CAtkinson at Circadence.com
Tue Feb 20 09:05:26 MST 2001


Is the bin/safe_mysql a typo?  Should it not be /bin/safe_mysql?  Also,
safe_mysql is a shell script.  You can inspect it for problems and you can
also put in a "set -xv" near the top to watch the execution.  

Chip

> -----Original Message-----
> From: John Starkey [mailto:jstarkey at advancecreations.com]
> Sent: Monday, February 19, 2001 10:43 PM
> To: lug at lug.boulder.co.us
> Subject: Re: [lug] Scripting something that relies on pwd
> 
> 
> The "start_mysql" script is the same one i created and it's 
> not working.
> Same result
> 
> bin/safe_mysql: No such file or directory.
> 
> Thanks.
> 
> John
> 
> Tkil wrote:
> 
> > >>>>> "John" == John Starkey <jstarkey at advancecreations.com> writes:
> >
> > John> I need to start mysql on boot and it's only allowing 
> me to do so
> > John> from it's parent dir. I've tried adding to rc.local 
> (when it was
> > John> running at boot) and adding a script in the mysql parent
> > John> dir. But that didn't work. Do i need to chroot when i do this?
> > John> If so , how do i get back out for the rest of the 
> boot? If not.
> > John> Anyone know how i can do this?
> >
> > typically, you start a sub-process with a different working 
> directory
> > by using a subshell, invoked with parentheses:
> >
> >    $ ( cd /path/to/wherever; ./bin/run_me & )
> >
> > (maybe put the ampersand outside the parens?)  this should work in
> > rc.local as well.
> >
> > in the case of mysql in particular, it ships with a script 
> that can be
> > used with the sysv-init style /etc/rc.d/* directories, and 
> i've never
> > had a problem with cwd using that script.
> >
> > t.
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 



More information about the LUG mailing list