Re: init script can't find /bin/dirname
On 2014-12-22 19:23 +0100, Rob Owens wrote: > $ ls -l /bin/dirname > -rwxr-xr-x 1 root root 13880 Jan 30 2007 /bin/dirname > > $ file /bin/dirname > dirname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), > dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped > > Similar thing for /bin/basename and a bunch of other files that are > present in both /bin and /usr/bin. For all the duplicates I've checked, > the files in /bin are 32-bit and are old, while the files in /usr/bin > are 64-bit and are recent. > > So I guess for now I'm going to move all these obsolete files into > another directory and make sure the system works ok before I delete them > for good. I'm not sure how this system ended up like this, but it's and > old system that's been dist-upgraded many times as well as having the > hard disk moved to different hardware. > > I checked Wheezy, Squeeze, and Lenny and the coreutils package doesn't > put dirname or basename in /bin on any of those releases -- they go in > /usr/bin. I wasn't able to go farther back than that. But 2007 is when > Etch was released, and that was also the first Debian release I ever used. Indeed, the file size and date above match the dirname executable from the i386 coreutils package in Etch[1], but even that package installed dirname in /usr/bin. Why somebody copied this and other files to /bin is probably impossible to tell now. Cheers, Sven 1. http://archive.debian.net/etch/i386/coreutils/download -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/87h9wnfpl9@turtle.gmx.de
Re: init script can't find /bin/dirname
On Mon, Dec 22, 2014 at 10:55:15AM -0500, Rob Owens wrote: > On Mon, Dec 22, 2014 at 04:41:05PM +0100, Sven Joachim wrote: > > On 2014-12-22 04:10 +0100, Rob Owens wrote: > > > So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and > > > "basename" when running at system boot, but it can find them when run > > > from a terminal after boot. > > > > Maybe you have a /bin/dirname executable whose interpreter is missing, > > e.g. it could be a 32-bit binary and you don't have libc6:i386 > > installed anymore. > > That's it! This system has a /bin/dirname as well as /usr/bin/dirname. > When I call /bin/dirname from a shell, I get "-bash: /bin/dirname: No > such file or directory". $ ls -l /bin/dirname -rwxr-xr-x 1 root root 13880 Jan 30 2007 /bin/dirname $ file /bin/dirname dirname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped Similar thing for /bin/basename and a bunch of other files that are present in both /bin and /usr/bin. For all the duplicates I've checked, the files in /bin are 32-bit and are old, while the files in /usr/bin are 64-bit and are recent. So I guess for now I'm going to move all these obsolete files into another directory and make sure the system works ok before I delete them for good. I'm not sure how this system ended up like this, but it's and old system that's been dist-upgraded many times as well as having the hard disk moved to different hardware. I checked Wheezy, Squeeze, and Lenny and the coreutils package doesn't put dirname or basename in /bin on any of those releases -- they go in /usr/bin. I wasn't able to go farther back than that. But 2007 is when Etch was released, and that was also the first Debian release I ever used. Sven, thanks for your help. Your tips got me heading down the right track. -Rob signature.asc Description: Digital signature
Re: init script can't find /bin/dirname
On Mon, Dec 22, 2014 at 04:41:05PM +0100, Sven Joachim wrote: > On 2014-12-22 04:10 +0100, Rob Owens wrote: > > So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and > > "basename" when running at system boot, but it can find them when run > > from a terminal after boot. > > Maybe you have a /bin/dirname executable whose interpreter is missing, > e.g. it could be a 32-bit binary and you don't have libc6:i386 > installed anymore. That's it! This system has a /bin/dirname as well as /usr/bin/dirname. When I call /bin/dirname from a shell, I get "-bash: /bin/dirname: No such file or directory". My other Wheezy system (which was installed as a 64-bit system) only has /usr/bin/dirname. OK, I guess I've got a little research to do. If you have any clue how to straighten this out, I'm all ears. Thanks for all your help! -Rob signature.asc Description: Digital signature
Re: init script can't find /bin/dirname
On 2014-12-22 04:10 +0100, Rob Owens wrote: > I rebooted and found that the path is fine: > > /sbin:/usr/sbin:/bin:/usr/bin A notable difference to the default PATH of a logged in user (with the standard /etc/profile, anyway) is that init places /bin before /usr/bin. > So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and > "basename" when running at system boot, but it can find them when run > from a terminal after boot. Maybe you have a /bin/dirname executable whose interpreter is missing, e.g. it could be a 32-bit binary and you don't have libc6:i386 installed anymore. Cheers, Sven -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/87oaqvg0a6@turtle.gmx.de
Re: init script can't find /bin/dirname
On Sun, Dec 21, 2014 at 06:07:20PM -0500, Rob Owens wrote: > On Sun, Dec 21, 2014 at 10:32:07PM +0100, Sven Joachim wrote: > > On 2014-12-21 21:58 +0100, Rob Owens wrote: > > > 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 rebooted and found that the path is fine: /sbin:/usr/sbin:/bin:/usr/bin So I'm still not sure why /etc/init.d/mysql cannot find "dirname" and "basename" when running at system boot, but it can find them when run from a terminal after boot. Any advice would be appreciated! -Rob signature.asc Description: Digital signature
Re: init script can't find /bin/dirname
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 signature.asc Description: Digital signature
Re: init script can't find /bin/dirname
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). > 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 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". Cheers, Sven -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/87y4q0g04o@turtle.gmx.de
init script can't find /bin/dirname
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. 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. 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? -Rob signature.asc Description: Digital signature