root, shell change [ answers ]

From: Toussaint (
Date: Thu Nov 07 1996 - 18:55:38 CST

thanks to all those who helped out.. and pointed very important info. to me.
mounted file systems.. and so on.. / /usr

here are some of the reasons:
Oh dear! Change roots shell back to /sbin/sh as
*immediately*. You'll be in trouble if you try to boot single user and
there's a problem with /usr if you don't.

 Didn't you notice that /sbin/sh and /usr/bin/sh are different ?

burns>file /usr/bin/sh /sbin/sh
/usr/bin/sh: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, s
/sbin/sh: ELF 32-bit MSB executable SPARC Version 1, statically linked, st


Another thing to keep in mind is that, generally, /usr tends to be
a different partition than the root partition. Meaning if you ever lose
/usr, you'll be completely hosed (if you lose the root partition you
have greater problems, but that's another story). A lot of people
just copy their favorite shell into /sbin assuming that it will solve
the above problem, however, most shells in /usr are dynamically linked
meaning, they *need* /usr/lib/lib*.so! so you're back to the original
problem. My advice is to never, repeat *NEVER* change root's shell
and in root's login files, test see if /usr is mounted that your
favorite shells exists and is executable and then exec it. Well, i'll
stop preaching now ;-)



answer below from, dmick@pongo73:

stty erase
PATH=$PATH:/usr/ccs/bin:/usr/local/bin; export PATH

if [ `expr "$0" : '.*ksh'` = 0 ]

runlevel=`who -r | nawk '{print $3;}'`

echo "shell is $shell"
echo "runlevel is $runlevel"

if [ $runlevel = "3" -a $shell = "bourne" ]
        EDITOR=vi ; export EDITOR
        echo "starting /bin/ksh"
        exec /bin/ksh

thanks.. again all and also

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:15 CDT