[6286] in Release_7.7_team

home help back first fref pref prev next nref lref last post

Re: Bringing bashrc and cshrc into sync

daemon@ATHENA.MIT.EDU (William Cattey)
Fri Mar 13 19:31:57 2009

In-Reply-To: <alpine.DEB.1.10.0903121748270.22031@vinegar-pot.mit.edu>
Mime-Version: 1.0 (Apple Message framework v753.1)
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Message-Id: <889024C1-C33F-4EF1-A3D3-CD2E0809CCB9@mit.edu>
Cc: Jonathan Reed <jdreed@mit.edu>, Tim Abbott <tabbott@mit.edu>
Content-Transfer-Encoding: 7bit
From: William Cattey <wdc@MIT.EDU>
Date: Fri, 13 Mar 2009 19:30:44 -0400
To: debathena@mit.edu, release-team@mit.edu
X-Spam-Flag: NO
X-Spam-Score: 0.00

jdreed chatted with me about this in person yesterday, and the plan  
seems pretty bulletproof to me.
I say let's go ahead and do it!

-Bill

On Mar 12, 2009, at 11:38 PM, Tim Abbott wrote:

> Seems like a reasonable strategy.  There's some real work involved in
> getting together the transition documents and making sure they're  
> really
> clear, but it seems doable.
>
> The main question I'm not sure about is this: How do we expect  
> users who
> use both Debathena and Athena 9 machines during the transition  
> interval to
> configure their dotfiles?  Perhaps it's the case that since we're  
> simply
> removing idempotent settings, if they want the setting back they can
> simply add them to their dotfiles and it'll work fine on both  
> platforms,
> and have the right end result once Athena 9 stops existing...
>
> 	-Tim Abbott
>
> On Thu, 12 Mar 2009, Jonathan Reed wrote:
>
>> After consulting with Oliver and Bill, with valuable input from  
>> Jacob, I would
>> like to move forward on bringing the bash and tcsh configurations  
>> into sync.
>> We're going to do this by punting a lot of legacy behavior on  
>> Debathena, and
>> providing an easy way for users to revert if necessary.   Athena 9  
>> will not
>> change, obviously.   This is kind of a long e-mail, but please  
>> send me any
>> feedback, *particularly if there will be any ill effects on tcsh  
>> users that I
>> have not listed below*.    I know there has been a flood of mail  
>> recently, but
>> hopefully this will be the last on the dotfiles/shells topic.  I'd  
>> like to
>> move forward with this by early April, if not sooner.
>>
>> Here's the proposal:
>>
>> - We punt a lot of customizations from /usr/athena/lib/init/ 
>> {cshrc,login} (see
>> full list at the end of this mail), thus bringing cshrc largely  
>> into sync with
>> bashrc.
>> - We create sample cshrc.mine and bashrc.mine files (drafts in
>> /mit/jdreed/debathena/) that users can prepend to their  
>> existing .cshrc.mine
>> and .bashrc.mine files to emulate Athena 9 behavior.
>> - At the beginning of the summer, before we start deploying  
>> Debathena in a
>> widespread manner, we lert everyone and let them know about this  
>> change, and
>> point them at a web page explaining what has changed, if/how it  
>> applies to
>> them, and how to fix it.
>> - Related to the previous item, the dotfiles for both shells  
>> should desupport
>> the skip_lert option.  Support has decided that this was a  
>> terrible idea and
>> lert really should run every time.  The average user only ever  
>> gets lerted
>> _once_, at deactivation time, and there's no benefit to allowing  
>> users to skip
>> this, since you can essentially skip it by running "lert -n".
>>
>> This has the following benefits:  We get rid of a lot of cruft  
>> now, and bring
>> bashrc and cshrc into sync.  This is valuable, because the single  
>> largest
>> source of people's Athena customizations is other Athena users.   
>> If we
>> retained the current setup, tcsh users who switch to bash will be  
>> sad when
>> some variables and aliases vanish and some behavior changes.  Bash  
>> users who
>> switch to tcsh to "get their account the same as their friend's  
>> account" will
>> also be sad.
>>
>> This has the following effects on existing tcsh users under  
>> Debathena:
>>
>> - ~/.path files will be ignored, and users will get the default  
>> path unless
>> they customize it in .cshrc.mine.  ~/.path currently screws over  
>> new users at
>> the rate of about one or two every year anyway, and it's time to stop
>> supporting it.
>> - Users who reference variables that we're punting (athena_path,
>> athena_manpath, host, hosttype, bindir, cdpath) will be unable to  
>> login.  Of
>> these, athena_path and athena_manpath seem the most common, and  
>> those users
>> already can't log in on Debathena, since athena_manpath isn't set,  
>> and
>> athena_path is only set for ~/.path users.
>> - Users who use the {s,t,}extend aliases in their .environment  
>> will lose those
>> customizations (are there any of these users left?)
>> - Users who use the extend alias elsewhere will get "command not  
>> found"
>> - Keybindings for ^W, ^Z, and " " will change to their defaults.
>> - cdpath won't be set, so users used to using this behavior will  
>> have to
>> explicitly cd into subdirs of their home directory
>> - noclobber and ignoreeof won't be set.
>> - the prompt will change to the tcsh default  (e.g. w20-575-1:~> ).
>>
>> This has the following effects on bash users under Debathena:
>>
>> - CDPATH will not be set
>> - PS1 will be the default prompt (e.g. joeuser@w20-575-1:~$ )
>>
>> Here are the lines I propose to remove from /usr/athena/lib/init/ 
>> cshrc, with
>> commentary where appropriate:
>>
>> Line 12:
>>> # Compatibility with older versions of Athena tcsh
>>> set autolist=""
>>> if ($?tcsh) then
>>>  bindkey "^W" backward-delete-word
>>>  bindkey "^Z" complete-word
>>>  bindkey " " magic-space
>>>
>>> endif
>>
>> Line 21:
>>> # Set host type and hostname variables.
>>
>>> if (! $?ATHENA_HOSTTYPE) setenv ATHENA_HOSTTYPE "`/bin/machtype`"
>>> if (! $?HOST) setenv HOST "`hostname`"
>>> setenv HOSTTYPE "$ATHENA_HOSTTYPE"
>>> set hosttype=$HOSTTYPE
>>> set host=$HOST
>>
>>
>> tcsh sets $HOST to `hostname` by default, so we can punt that.
>> ATHENA_HOSTTYPE is only set in tcsh, not bash.  Can we punt it and  
>> just keep
>> $HOSTTYPE?   I think we can also kill the two shell variables  
>> (host and
>> hosttype).
>>
>> Line 67:
>>>  set bindir=arch/${ATHENA_SYS}/bin
>>
>> This should move into /usr/athena/lib/init/env_setup, which  
>> appears to be the
>> only place it's used.
>>
>> Line 88:
>>>  # This "extend" alias and friends have been left in for backwards
>>>  # compatibility with old .environment files, just in case. The new
>>>  # add alias does not use them.
>>>  alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set  
>>> extendyes && \\
>>>  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!: 
>>> 1 && \\
>>>  if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
>>>  unset extendyes'
>>>  alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set  
>>> extendyes && \\
>>>  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!: 
>>> 1 && \\
>>>  if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\
>>>  unset extendyes'
>>>  alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set  
>>> extendyes && \\
>>>  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!: 
>>> 1 && \\
>>>  if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\
>>>  unset extendyes'
>>>
>>
>>>  # Run user environment customizations identified in your
>>>  # ~/.environment file.  This is the place to include your own
>>>  # environment variables, attach commands, and other system wide
>>>  # setup commands.  You can also cancel default behaviors listed
>>>  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
>>>  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
>>>  # customizations" option when you logged in).
>>>
>>>  if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
>>>
>>>  unalias extend sextend textend
>>
>> Replace this with a single line sourcing ~/.environment, and  
>> remove the
>> aliases.
>>
>> Line 116:
>>> if ((! $?NOCALLS) && (-r ~/.path)) then
>>>    # Support .path files for compatibility.
>>>    set athena_path=($path)
>>>    source ~/.path
>>>  else
>>>    # Standard Athena path additions.
>>>    set path=(`/usr/bin/athdir $HOME` $path .)
>>>  endif
>>
>> Replace this with a single line setting $path to $path plus  
>> "athdir $HOME"
>>
>> Line 127:
>>> # Set appropriate bin directory variable for this platform
>>> # (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;   
>>> this will
>>> # be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
>>> set bindir=arch/${ATHENA_SYS}/bin
>>
>>
>> bindir is set twice - once above, in the "ENVIRONMENT SETUP"  
>> section, and once
>> here.
>>
>> Line 134:
>>> # Set up standard C shell initializations
>>>
>>> set noclobber                   # Don't overwrite files with  
>>> redirection
>>>
>>> if ($?prompt) then              # For interactive shells only  
>>> (i.e., NOT
>>> rsh):
>>>  # Set prompt.
>>>  set promptchars="%#"
>>>  set prompt = "athena%# "
>>>  set cdpath = (~)
>>>  set interactive               #   Provide shell variable for  
>>> compatability
>>> endif
>>
>>
>> Kill it and make users use the standard prompt and don't set  
>> noclobber.
>>
>> For /usr/athena/lib/init/login I propose we remove the "set  
>> ignoreeof" on line
>> 56.
>>
>> -Jon
>>
>>


home help back first fref pref prev next nref lref last post