The HEPiX Shells and X11 Login Scripts Project

Implementation at CERN

User Guide

Arnaud Taddei - Arnaud.Taddei@cern.ch


Abstract:

This document describes how the user can customise the HEPiX scripts. It gives some examples and provides references for further reading.


Contents


1 Introduction

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.


2 User customisations

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.

2.1 How can you specify your preferred group?

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.

2.2 How can you change the behaviour of the RUBOUT sequence?

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.

Backspace
you need to create a $HOME/.BackSpace file.
Delete
you need to create a $HOME/.Delete file.

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.

2.3 How can you change your prompt?

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'

2.4 How can you define your own aliases or functions?

2.5 How can you customise your PATH?

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.

2.6 How can you set your own environment variables?


2.7 How can you customise and understand your X11 environment?

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:

2.7.1 The xsession.log file

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

2.7.2 The xprofile file

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:

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

2.7.3 The xkeyboard file

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.

2.7.4 The xclients file

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.

2.7.5 The xresources file

This file is used to specify client resources.


3 User templates

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:

1
the header part which gives the email address in case of serious problems, the version number, the generation date, the authors, etc.
2
the hook to the HEPiX scripts. This hook is not required if the HEPiX scripts are installed in enforced mode. You should anyway NEVER remove these 3 lines for the C-shell users
        if ( -r /usr/local/lib/hepix/central_env.csh ) then
           source /usr/local/lib/hepix/central_env.csh
        endif
or 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
        fi
You can find something similar to these lines here.
3
commented lines. All these lines can be uncommented. They give users examples of what they can do and you can choose now to use them. They can use it, remove it, update it as they wish.

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.


4 uco command

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


5 Acknowledgments

Thanks to Roger Jones, Anne Ryan, Francesco Giacomini, Alessandro Miotto and Alan Silverman for their feedback and help on this documentation.


References

1
Philippe Defert, Alain Peyrat, and Ignacio Reguero. ASIS - User's and Reference Guide. Guide CN/CO/152, CERN, Geneva, April 1995. Version 3.00.

2
Axel Köhler and Arnaud Taddei. Proposal for a Common Script and X environment at DESY and CERN . Guide CN/DCI/168, CERN, Geneva, April 1994.

3
Arnaud Taddei. Customising your shell - tcsh specific . Guide CN/DCI/172, CERN, Geneva, April 1994.

4
Arnaud Taddei. Customising your shell - zsh options . Guide CN/DCI/171, CERN, Geneva, April 1994.

5
Arnaud Taddei. Customising your shell - zsh specific . Guide CN/DCI/175, CERN, Geneva, April 1994.

6
Arnaud Taddei. Shell-Choice - A Shell Comparison . Guide CN/DCI/162, CERN, Geneva, April 1994.

7
Arnaud Taddei. Shell Support - tcsh and zsh for pedestrians . Guide CN/DCI/163, CERN, Geneva, April 1994.

8
Arnaud Taddei. Should I have a dot ('.') in my PATH . Guide CN/DCI/170, CERN, Geneva, 1994.

9
Arnaud Taddei. HEPiX Login Scripts Project - Implementation at CERN: Concepts. Guide, CERN, Geneva, April 1995.

10
Arnaud Taddei. HEPiX Login Scripts Project - Implementation at CERN: Reference Guide. Guide, CERN, Geneva, April 1995.

11
Arnaud Taddei. HEPiX Login Scripts Project - Implementation at CERN: System Administrators Guide. Guide, CERN, Geneva, April 1995.

12
Arnaud Taddei. HEPiX Login Scripts Project - Implementation at CERN: User Guide . Guide, CERN, Geneva, April 1995.

13
Arnaud Taddei, Axel Köhler, Thomas Finnern, and Lionel Cons. Architectural Design Documentation of the HEPiX scripts . Guide, CERN, Geneva, September 1995.

14
Rainer Többicke. SUE. Specifications, CERN, Geneva, April 1995. Version 1.0.


This document had been translated from LaTeX source using the command:
latex2html -split 0 -t "HEPiX Shells and X11 Login Scripts - Implementation at CERN: User Guide" -no_navigation -info "" -show_section_numbers user-guide.tex

...Taddei
CERN - Arnaud.Taddei@cern.ch



Arnaud Taddei
Tue Dec 12 22:16:24 MET 1995