Subject: Re: init: can't exec /bin/bash for /etc/rc: Exec format error
To: George Michaelson <ggm@apnic.net>
From: Brian Rose <lists@brianrose.net>
List: current-users
Date: 06/24/2003 22:17:57
I looked throughout /etc /etc/rc.d /usr/pkg/etc and /usr/etc/rc.d for bash references, but the only ones I found are in the passwd and master.passwd files for some users.

I did move bash to /bin so that I could have access to it in single user mode. But I did not modify root to use bash by default. I remember hearing of dire consequenses to those modifying the default root options.

bash was linked statically on my system (ldd returned "not dynamically linked").

Anyway, it's working for now. I have a good amount of data to restore, so I'll look at the problem tomorrow.

Thanks for all the help.

George Michaelson wrote:
> 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
> 
>