Arnaud Taddei - Arnaud.Taddei@cern.ch
This document describes how the user can customise the HEPiX scripts.
In order to provide a common user environment on UNIX Systems
a set of scripts was designed first by the DESY UNIX Committee (DUX)
and then by a joint project between DESY and CERN
(see [13] which obsoletes
[2]).
These scripts set up the user environment which includes
the shell environment and the graphical environment (X11)
(in beta version now). The "startup scripts" (shell environment)
provide a way for users to login, work in interactive and batch mode
for the most common shells and platforms.
The following sections gives examples of what you can do to customise your
environment, using features available via the HEPiX Shells and X11 login
scripts and for further reading you can access several related documents
listed in the bibliography.
The user can customise his environment with his own dot files. The
following table gives the user files which are executed for each shell
Table 1: Standard configuration files for the different shells
We will give some examples of tailoring the user environment to
personal taste.
Let's assume that you belong to several groups and sometimes you need
the environment of one group and in other circumstances you need the
environment of another group. In UNIX, there is the notion of
primary group and once you logged in, your group id is set to
that of the primary group. The HEPiX scripts provide you with a way of
specifying the
group name from which you want to get the environment using a file
$HOME/.hepix/preferred-group
. In this file you simply enter
the name of the group that you want.
Practical example: I belong to groups c3, c4 and c5. On the system
plus1, my primary group is c3 but I want to inherit the environment
of group c5. Then, I simply edit the file $HOME/.hepix/preferred-group
and I enter c5 in the first line.
Thus, the next time that I login, I will get the environment of group c5.
For instance this mechanism doesn't allow you to specify that you would like to inherit the environment from a group 1 on a service A and from a group 2 on a service A. Thus when you set a preferred group it is set for all the accounts on which you are using this home directory. If for example you have an AFS account and you set a preferred group, then it will be used on all the services on which you are using your AFS Home directory.
There are many different keyboards available on the site. Keyboards are
sending signals and unfortunately, as there was no formal standard, it
exists some clashes on how to interpret this or that signal. The signal
which is sent to erase a character is called the RUBOUT sequence.
Some keyboards may send ^?
which corresponds to a Delete and some
keyboards may send ^H
which corresponds to a BackSpace.
Thus the HEPiX shells login scripts provide a environment variable named
RUBOUT which you can modify to 2 values : BackSpace or Delete.
In order to get a Backspace from the RUBOUT sequence enter the command:
touch $HOME/.BackSpace
In order to get a Delete from the RUBOUT sequence enter the command:
touch $HOME/.Delete
It will then be valid at the next login.
If you want to include the current path in your C-Shell prompt then you have to define the following alias for the cd command.
alias cd chdir \!:\* \; set prompt='${cwd}\[!\]\ ' \; setenv CWD '$cwd'
Customising your PATH is a fundamental issue which you should fully understand. Document [8] gives interesting input on this topic especially about the security issues when having a dot ( .) in the PATH.
With version 3.x.x of the HEPiX scripts, an X11 package is provided to you
and gives you an Xsession default. Under $HOME/.hepix
directory
you will find the following files:
xsession.log
xprofile
xclients
xkeyboard
xresources
This file contains the log of the HEP Xsession. When you " Xlogin"
the HEP_Xsession
program is executed and you can get a trace of its
execution in the file
$HOME/.hepix/xsession.log
This file is a user configuration file to customise the HEP Xsession.
This is a bourne shell script which contains typically the setting of
several "Major Switches". A Major Switch is a variable which controls the
flow of the Xsession.
Figure 1 illustrates the possible behaviours
you can get from the customisation of the xsession through
Figure 1: Model of the HEP_Xsession
Examples are:
HX_SOURCEPROFILE
/usr/local/bin/X11/fvwm
(default)
$HOME/.xsession
Example of xprofile file
HX_WM=/usr/local/bin/X11/fvwm HX_LAST_CLIENT="/usr/bin/X11/xterm -ls -sl 1000 -sb" HX_SOURCEPROFILE=yes if [ "$OS" = AIX ]; then HX_DESKTOP=CDE fi if [ "$OS" = "HP-UX" ]; then HX_DESKTOP=HP-VUE fi if [ "$OS" = "OSF1" ]; then HX_DESKTOP=DXSESSION fi
This file is used to specify which keyboard name should be used with
the current DISPLAY.
Example of xkeyboard file
#======================================================================# # The basic format of this file is: # # # # Keyboard-name # All keyboards map to this one # or # # Display-IP-number Keyboard-name # Only the keyboard attached to # or # Display-IP-number is mapped # Display-name Keyboard-name # Only the keyboard attached to # or # Display-name is mapped # #-------------# # # # Display-name|Display-IP-number Keyboard-name # Keyboard attached # # to Display-IP-number # #-------------# or to Display-name # # is mapped to Keyboard-name #---------------------------------------------------------------------- # NCD101 # 128.141.198.155 NCD102 # mish156.cern.ch SGI # mish157.cern.ch|128.141.198.156 Sun
Consult the template xkeyboard file. The uco command may help you to set a keyboard xmodmap file or see the CERN XTerminal Guide from L. Cons which contains a few amount of information.
This file is used to specify the clients which have to be launched at
the beginning of the session. Please keep the number of clients small
when you are working on a multi-user service. Other users want to work
and launch programs as well!
Example of xclients file
sleep 1; xterm -geometry 80x24+10+10 -n login -T login -ls -sb -sl 256 & sleep 1; xclock -geometry 120x120-0+0 -hl Yellow -bg DarkGreen -fg White -hd Red &
Consult the template xclients file which is provided.
This file is used to specify client resources.
In each newly created account all the templates files for the customisation of
the shell are provided. You can edit these files using the examples
described in the previous section to customise their environments.
In these templates you will find 3 parts:
if ( -r /usr/local/lib/hepix/central_env.csh ) then source /usr/local/lib/hepix/central_env.csh endifor the following lines for the Bourne-shells users:
if [ -r /usr/local/lib/hepix/central_env.sh ]; then . /usr/local/lib/hepix/central_env.sh fiYou can find something similar to these lines here.
These templates give other examples and, for tcsh or zsh shells,
there are other related documents like [7],
[3], [4],
[5].
Templates also exist for the xprofile, xclients and xkeyboard files as well.
The uco command is a perl program which you can use to reset your
environment in case it has been corrupted or you have made a mistake in
customising your environment. This command can be used to reset your
shell profiles files, some of your mail default files and some of your
security files. Type uco -h
to get a quick help.
In addition, this command can help you to set, reset or analyse some of your customisation.
It can do it on several areas like the shell, X11, the setting of the
keyboard in the context of X Window, the security, the structure of your
home directory.
It will present you a menu and you can choose what you want to do. You can
set the flags -n to see what the command would do (without
actually performing any operations). The -v flag is verbose mode and
the command informs you what it is doing.
.
Of course it saves your files by appending a number
in the file name. For example, assume that it is the first time you run
uco on the
shell area to reset your environment
and lets assume that your login shell is tcsh, then you will find
.tcshrc.1 and .login.1 files in your HOME directory. If
it is the 1000th time you run the command you will find 1000 files in your
HOME directory, the last ones being: .tcshrc.1000 and
.login.1000
Thanks to Roger Jones, Anne Ryan, Francesco Giacomini, Alessandro Miotto and Alan Silverman for their feedback and help on this documentation.
latex2html -split 0 -t "HEPiX Shells and X11 Login Scripts - Implementation at CERN: User Guide" -no_navigation -info "" -show_section_numbers user-guide.tex