Subject: Re: init: can't exec /bin/bash for /etc/rc: Exec format error
To: Brian Rose <lists@brianrose.net>
From: George Michaelson <ggm@apnic.net>
List: current-users
Date: 06/25/2003 12:00:55
On Tue, 24 Jun 2003 21:44:27 -0400 Brian Rose <lists@brianrose.net> wrote:

> fsck returned a clean filesystem.
> 
> root was configured for /bin/sh
> 
> root has the following...
> .Xauthority
> .cshrc
> .ddd/
> .klogin
> .login
> .mozilla/
> .profile
> .shrc
> .xinitrc
> ... other data files and directories including a bash script I use for
> renaming files. This script is invoked manually, not from any scripts.
> 
> copying /bin/sh into /bin/bash did the trick. Now how do I restore /bin/bash
> or find the original problem?


You can get /bin/bash back by installing bash from pkgsrc and copying it out of
/usr/pkg/bin/bash where it should be. Nothing in NetBSD default install makes
/bin/bash, so it got into /bin by somebody manually putting it there.

finding the original problem.. init is calling rc which is calling a range of
stuff in /etc and /etc/rc.d/ -If you are saying that

	grep bash /etc/rc* /etc/rc.d/* 

has no matches then its an indirect reference to /bin/bash via something else,
not directly in the RC system itself. Ie an invoked program.

I looked in /bin, /sbin, /usr/bin, /usr/sbin and found nothing in my NetBSD
current but I did find /usr/pkg/bin had some bash scripts. So I suspect this is
going to be the rc/init process thats walked into /usr/pkg/etc/rc.d/ or else
something manually put into the call-chain for init/rc.

cheers
	-george