From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Fri Sep 19 2003 - 09:31:18 EDT
Hi all, "Flemming Videbaek" <videbaek@rcf.rhic.bnl.gov> wrote concerning Fw: What to do about dot files? [Mon, 15 Sep 2003 18:14:34 -0400] ---------------------------------------------------------------------- > An issue has come up at RCF namely that the efault .chsrc .profile > etc files are no good for almost anyone. True. > If we can agree on a 'simple' such script these can become deafult > for new users? If you think this is a good idea please circulate > suggestions. It's a good idea. However, on Red Hat Linux you shouldn't directly modify the files in `/etc/skel/' to make global changes for all user. Instead, one should add (small) scripts to `/etc/profile.d/' as these will be executed by a _login_ shell. > It is a requirement IMHO that they are simple i.e. no extra stuff > you personly like and secondly they will allow users to use the > default brahms software reight away w/o changing the files. One question: Are these dot files specific to experiments or for all experiments? One can still make things specific for the experiments, when putting simple scripts in `/etc/profile.d/' - for example, one could do for `csh'-like shells: foreach g (`id -Gn`) switch ($g) case "*brahms": # Do BRAHMS stuff breaksw case "*star": # Do STAR stuff breaksw # more cases default: # Fall-back breaksw endsw end or for `sh'-like shells: for g in `id -Gn` ; do case $g in "*brahms") # Do BRAHMS stuff ;; "*star") # Do STAR stuff ;; # more cases *) # Fall-back ;; esac done > | We currently give a .cshrc file to all new RCF users that is kind > | of Solaris-like, and likely to please very few. Meaning: `Solaris == Useful for nobody' :-) > | The only exception we have is Star, who gave us their own dot > | files a few years ago. I guess this means that the dot files are experiment specific. > | In ticket 9148, Marguerite Tonjes indicates that > | > | "standard .cshrc for new users & .login over-writes PATH" Ah!, a classic error. The `.cshrc' and `.bashrc' should _never_ _ever_ override the variables PATH LD_LIBRARY_PATH TERM CVSROOT and similar. The idea is, that when you start a sub-shell, you should inherit the environment from your login shell plus the changes you may have made. Say you do prompt> setenv LD_LIBRARY_PATH=/some/where/lib prompt> setenv PATH=/some/where/bin:${PATH} prompt> make Now, `make' will start (several) sub-shells. What you expect to happen, is that the `PATH' and `LD_LIBRARY_PATH' is the one you set before executing `make' - not the one from the login. However, if `.cshrc' or `.bashrc' overwrites these variables, you'll get the wrong environment. Not good. Also watch out for `tset' and similar, that manipulates the terminal - these may well screw up SSH logins. And _never_ _ever_ put `.' (current directory) in to the variables `PATH' and `LD_LIBRARY_PATH' as they can do a lot of harm (think Trojan horses, and the likes). > | and that > | > | "I find that in their .cshrc, they over-write the path, by not > | doing set path = ($path ) in their commands. I then found that > | 90% of our users do this, and it's because it's part of the > | original .cshrc that they come with! Talking about `bad defaults'! I strongly believe that users `.cshrc' and `.bashrc' should _never_ever_ even think to touch the environment variables mentioned above (as well as others). In fact, a `.cshrc' should largely be empty! > | This means that a large percentage of RCF users are not getting > | any automatic PATH settings as they are over-written. For this > | one user, it meant that their K5 password did not make a K5 > | ticket, and that they couldn't make one." Ah, the problem that you some times get sub-shells even if you didn't ask for it. Again, this can be prevented by making `.cshrc' and `.bashrc' nearly empty (a comment should do :-) > | We are open to suggestions. If each collaboration would point us > | to an acceptible file, we could have a .cshrc that checks the > | group and creates the path from the file. This is just one idea. The files rcf:~brahmlib/etc/brahms.login rcf:~brahmlib/etc/brahms.profile is more or less what we want. They are not simple, but could be vastly simplified by yanking out the architecture specific settings that we don't really use any more (as far as I know, that is). Also, if RCF can guaranty a sane set of directories in the `PATH' and `MANPATH' environment variables, we can remove a lot of stuff and we're basically left with, for `csh'-like shells: # Basic path for BRAHMS setenv PATH /afs/rhic.bnl.gov/opt/brahms/pro/bin:${PATH} if ($?MANPATH) then setenv MANPATH ${MANPATH}:/afs/rhic.bnl.gov/opt/brahms/pro/share/man else setenv MANPATH /usr/share/man:/afs/rhic.bnl.gov/opt/brahms/pro/share/man endif # CERNLIB if ( -d /cern ) then setenv CERN /cern if ( $?CERN_LEVEL ) then setenv CERN_ROOT ${CERN}/${CERN_LEVEL} setenv PATH ${CERN}/${CERN_LEVEL}/bin:${PATH} endif endif # Aliases alias brahms-cvs 'cvs -d /afs/rhic.bnl.gov/brahms/BRAHMS_CVS' alias root-cvs 'cvs -d :pserver:cvs@root.cern.ch:/user/cvs' alias lf 'ls -FC' alias ll 'ls -al' # Shell settings umask 002 # Default permission is disallow # `other' write set history=60 # History of 60 entries set visiblebell # Do not bleep set notify # Check for new mail occasionally if ($?tcsh) then # Only valid for TCSH - no CSH set autolist = ambiguous # Tab-completion only when ambiguous set nobeep # Do not bleep set prompt='%B%n@%m%b:%U%~%u> ' # Nice prompt :-) endif # Show greeting if ($shlvl == 1) then if ( -f /brahms/u/brahmlib/etc/brahms.logo ) then cat /brahms/u/brahmlib/etc/brahms.logo else if ( -f /home/brahmlib/etc/brahms.logo ) then cat /home/brahmlib/etc/brahms.logo else if ( -f /direct/brahms+u/brahmlib/etc/brahms.logo ) then cat /direct/brahms+u/brahmlib/etc/brahms.logo endif endif and for `sh'-like shells # Basic path for BRAHMS export PATH=/afs/rhic.bnl.gov/opt/brahms/pro/bin:${PATH} if test ! "x$MANPATH" = "x" ; then export MANPATH=${MANPATH}:/afs/rhic.bnl.gov/opt/brahms/pro/share/man else export MANPATH=/usr/share/man:/afs/rhic.bnl.gov/opt/brahms/pro/share/man fi # CERNLIB if test -d /cern ; then export CERN=/cern if test ! "x$CERN_LEVEL" = "x" ; then export CERN_ROOT=${CERN}/${CERN_LEVEL} export PATH=${CERN}/${CERN_LEVEL}/bin:${PATH} fi fi # Prompt - note `^[' is an escape sequence export PS1='\[[0;1m\]\u@\h:\[[0;4m\]\w\[[0;0;0m\]$ ' # Aliases alias brahms-cvs='cvs -d /afs/rhic.bnl.gov/brahms/BRAHMS_CVS' alias root-cvs='cvs -d :pserver:cvs@root.cern.ch:/user/cvs' alias lf='ls -FC' alias ll='ls -al' # Shell settings umask 002 # Default permission is disallow # `other' write # Show greeting if test $SHLVL == 1 ; then if test -f /brahms/u/brahmlib/etc/brahms.logo ; then cat /brahms/u/brahmlib/etc/brahms.logo elif test -f /home/brahmlib/etc/brahms.logo ; then cat /home/brahmlib/etc/brahms.logo elif test -f /direct/brahms+u/brahmlib/etc/brahms.logo ; then cat /direct/brahms+u/brahmlib/etc/brahms.logo fi fi A really nifty little program to have installed is one called `path' [1], which can help the a lot in writing transparent scripts. Basically you use it as setenv PATH `path -a /afs/rhic.bnl.gov/opt/brahms/pro/bin` setenv LD_LIBRARY_PATH \ `path -var LD_LIBRARY_PATH -a /afs/rhic.bnl.gov/opt/brahms/pro/lib` and so on. > | Feedback welcome. Given above. Yours, ___ | Christian Holm Christensen |_| | ------------------------------------------------------------- | | Address: Sankt Hansgade 23, 1. th. Phone: (+45) 35 35 96 91 _| DK-2200 Copenhagen N Cell: (+45) 24 61 85 91 _| Denmark Office: (+45) 353 25 404 ____| Email: cholm@nbi.dk Web: www.nbi.dk/~cholm | | [1] http://www.tip.net.au/~dbell/
This archive was generated by hypermail 2.1.5 : Fri Sep 19 2003 - 09:32:07 EDT