On Sun, Dec 21, 2014 at 10:32:07PM +0100, Sven Joachim wrote:
> On 2014-12-21 21:58 +0100, Rob Owens wrote:
> 
> > The /etc/init.d/mysql script on one of my systems is complaning that it
> > can't find /bin/dirname and /bin/basename.  Line 24 of the script is
> > this:
> >
> > SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
> >
> > Both dirname and basename live in /usr/bin, not /bin.
> 
> Which should be fine from the script's point of view as long as
> $remote_fs is in the "Required-Start" header (i.e. /usr is guaranteed to
> be mounted).
> 
It is.  In any case, /usr is part of the / partition.  In case it
matters, /var is a separate partition.  And I'm using software raid 1
for both / and /var.

> > I know I could add a PATH statement to the init script, but this problem
> > is my own doing and I'd like to fix it right.  I "cross-graded" this
> > system from 32-bit to 64-bit using this guide:
> >
> > www.ewan.cc/?q=node/90
> >
> > It worked pretty well, but not perfectly.  Some things got missed, like
> > screen, ntp, and a couple other packages.  I'm thinking that maybe
> > another missing package is preventing the mysql init script from
> > checking for /usr/bin/dirname.
> 
> That seems to be unlikely, but you could add a line with "echo $PATH" to
> the script to find out what PATH actually is.
> 
I will do this, but I can't reboot just yet to check it out.  I will
post my findings later.

> > I can run '/etc/init.d/mysql start' from a terminal and it works fine,
> > because it picks up the PATH associated with the terminal.  So this is
> > only a boot-time issue.
> >
> > So is there a package or a  global setting somewhere that sets the PATH 
> > for init scripts?
> 
> PATH is set directly by init.  If I read the source code correctly,
> sysvinit sets it to "/sbin:/usr/sbin:/bin:/usr/bin" while systemd uses
> "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin".
> 
This is a Wheezy system, running with sysvinit.  

'man init' says:

ENVIRONMENT
       Init sets the following environment variables for all its
       children:

       PATH   /bin:/usr/bin:/sbin:/usr/sbin

So maybe it's not a path issue after all.  What else could it be then?
The boot messages clearly indicate that it's failing to find
/bin/dirname and /bin/basename.

Thanks for your help.

-Rob

Attachment: signature.asc
Description: Digital signature

Reply via email to