boot banner project
    Charles Swiger 
    cswiger at mac.com
       
    Wed May  4 19:18:02 PDT 2005
    
    
  
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
    
    
More information about the freebsd-current
mailing list