Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2005 22:16:33 -0400
From:      Charles Swiger <cswiger@mac.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: boot banner project
Message-ID:  <6dc0162f9029defe6980a9ae28bb5175@mac.com>
In-Reply-To: <20050504.185153.78707420.imp@bsdimp.com>
References:  <ff3ef3b2621f16316effcf296f044d93@mac.com> <20050504.163618.112621888.imp@bsdimp.com> <ddbd692bcfcae94e8417a228a95fbcfc@mac.com> <20050504.185153.78707420.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 4, 2005, at 8:51 PM, M. Warner Losh wrote:
> : The fact that the /etc/rc scripts, cron, and similar tools involving
> : root's environment are all run using /bin/sh is one of the primary
> : reasons why root shell ought to be /bin/sh.  There are newgroup FAQs
> : for various platforms which recommend against changing root's shell
> : from being a /bin/sh.
>
> That doesn't follow.

Do FreeBSD users ever have problems setting up cron jobs because their 
interactive environment and cron's are not the same?

> All my shell scripts run /bin/sh, yet my default shell is /bin/tcsh.

Sure; lots of people prefer another shell for interactive use.  It's 
not hard to do "exec tcsh", or put that in ~root/.profile, hopefully 
wrapped in a test for whether the shell is interactive.  I have a 
.cshrc floating around which has this near the end:

# skip remaining setup if not an interactive shell
if ($?USER == 0 || $?prompt == 0) exit

...and the end of a .login which looks like:

# Note: this section is for interactive shells.
case $- in *i*)
         eval `tset -s` 2> /dev/null
         if [ ! -f .hushlogin ]; then

# IMPORTANT: place commands that might produce output here.
quota -q
mesg y
msgs -fp 2> /dev/null

# allow the user to break the Message-Of-The-Day display.
#trap "trap '' 2" 2
#/bin/cat -s /etc/motd
#trap "" 2

         fi
esac

trap 2 3

Put an "exec tcsh" in there instead of the MOTD code (which clearly 
isn't needed on FreeBSD)....

> But like I've said twice now: There's lots of bigger problems in the
> tree, and a change like this could break things.  There's enough
> breakage in the tree now.

Data point: I've been running /bin/sh as root's shell on a bunch of 
machines with zero issues since 4.0.

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6dc0162f9029defe6980a9ae28bb5175>