Subject: Re: root shell?
To: Ben Cottrell <benco@pendor.mckusick.com>
From: David Brownlee <abs@anim.dreamworks.com>
List: port-mac68k
Date: 08/01/1997 08:46:46
On Fri, 1 Aug 1997, Ben Cottrell wrote:

> > does root shell have to be csh? i hate it. i'd far prefer bash or tcsh, but
> > when i tried using tcsh, cron and other programs that act as root made a
> > big fuss and stopped working properly :-(
> 
	I've used tcsh as a root shell since NetBSD 1.0 without
	problems... It sounds like there's something odd with your setup -
	what error messages do you get?

> The answer to your question as asked is that you need to add all shells
> you're going to use to /etc/shells, and then they'll be recognized as
> valid by the various utilities.
> 
	This shouldn't affect crontabs & suchlike (though it does need to
	be done for other things)

> However, there are a few reasons why csh is a *better* shell for root to
> have than tcsh, depending on your aesthetic unix-sense :-) Let's say your
> system is completely trashed--you have a replacement disk, but you need to
> restore your backup tapes onto it. So you're running off your backup root
> partition and you don't have a /usr, /usr/local/, or swap.
> 	* csh has a lower memory profile than tcsh, and works better with
> 	  no swap.

	Although lower I doubt this would be a real problem (from
	experience on 4MB sun3/50s :)
 
> 	* csh doesn't need to access the termcap, so it works better if
> 	  /usr isn't mounted.
	
	tcs will complain if it cant access termcap, but still function -
	you just lose the arrow keys. You still have ^P ^N ^B ^F etc for
	moving around in the command line. In this respect is is _better_
	than csh when your system is hosed. Working in single user mode
	with editable command line history is a real boon.

> 	* csh is statically linked, and tcsh probably isn't.

	Root's login shell should _always_ be statically linked. Anything
	else is a pilot error. The tcsh makefile has an option for linking
	statically.

> 	* if a user's shell doesn't exist, getty doesn't default to /bin/sh,
> 	  it just won't let the user log in. So if root's shell is tcsh
> 	  (in /usr/local/bin), root won't be able to log in.
> 
	Again putting root's shell in /usr/local is wrong - unless that is
	part of the root filesystem. It should always be on the root
	filesystem (I use /bin/tcsh)

	:)
		David