Subject: Re: bash problem
To: Tim Walls <tim.walls@pa.press.net>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-i386
Date: 01/14/2000 11:27:24
On Thu, 13 Jan 2000, Tim Walls wrote:

> > Andrew Todorov, writes:
> >> 
> >> when I change the shell for root to bash the chsh program send this message:
> >> 
> >> "warning,unknown root shell"
> > 
> > I would personally not use bash for a root shell. This is because it
> > usually sits in the /usr partition. I want root to be able to run a shell
> > even if the /usr partition gets corrupted - so I stick with /bin/csh.
> > (Actually, the first thing I do as root is usually type exec
> > /usr/pkg/bin/bash, but that's another story...)
> > 
> > My advice is: DON'T DO ANYTHING ABOUT THIS. Stick with /bin/csh.
> 
> Another good reason (IMHO) for not doing this, is that a decent shell
> (my favourite being tcsh, for what it's worth,) could well rely on some
> dynamic libraries[1].

Actually any program not compiled for static linking will rely on dynamic
libraries.

Just to be clear, dynamic libraries are the .so files in /usr/lib. When a
program uses routines in libc, rather than copying those routines into the
program, references are added which will point to the routines in the
shared library, which is linked in dynamically at execution time.

The reason it's a bad idea to have root use a dynamically-linked shell is
what happens if /usr (well /usr/lib/*so*) gets messed up? Then root's
shell won't work, and thus you can't fix the problem. :-(

I've done a few things over time. Either change the toor root account to
use bash, or add a new root account, say broot, which uses bash. That way
you can use the shell you want (su - toor or su - broot) but you still
have the static root shell around & available.

Or use "su -m". You log in as you, then use this su variant. It gives you
a root shell but using your prefered shell. :-)

Take care,

Bill