Computing Services

Classroom Services & Room Scheduling Unit

Web Services

E-Learning & Instructional Technology

Distance Education

Related Sites

Accessibility Statement. Privacy Statement.

symbol for authentication required denotes that authentication is required.

The Login Process for SPH Solaris 2.5.1 Machines

Stages of the login process

  • Get the username (uniqname) and password from the user.
  • Check the password file for information such as the user's UID and default shell (e.g. csh or tcsh).
  • Send the password to the kerberos server (part of the AFS server system).
  • If the password is correct, the kerberos server sends back a token which is to be used for all subsequent access to any file in AFS.
  • An initial, limited set of environment variables is created (see man login).
  • The system starts a shell or series of shells which process the global and user login files.
  • The shell presents a login prompt (%) to the user, ready to accept commands.

Processing of standard login files

  • For users with the C shell (csh) or TCSH (all SPH users use one of these two), these login files (also called dotfiles by tech people since the filenames often begin with a period) are processed in the order shown.
    1. /etc/.login We don't customize this in SPH.
    2. /afs/sph.umich.edu/common/skel/sys.cshrc
      This is actually called from the first line of ~/.cshrc (below) so it isn't really the second file processed; however all of the commands in this file are processed before the bulk of ~/.cshrc is processed. This is the file where we set up a lot of SPH-specific things. See Figure 1.
    3. ~/.cshrc
      The ~ means your home directory, e.g. ~ is the same as /afs/sph.umich.edu/user/s/someuser for the uniqname, someuser. This (and, therefore, file 2 above) is run each time a new C shell or tcsh starts up. This is the file that most users will customize. See Figure 2.
    4. /afs/sph.umich.edu/common/skel/sys.login
      This is called from the first line of ~/.login just as is done from ~/.cshrc. Messages displayed at login time are usually found here. Not much else goes on here. See Figure 3.
    5. ~/.login
      We don't use this file for much in SPH. See Figure 4.
  • When a new shell is opened without a new login (e.g. when opening up a new xterm), only files 2 and 3 are processed.
  • When a user is running X Windows (e.g. when logging in at a Sun workstation console), things get more complicated.
    The system processes these three extra files early on in the process:
    1. /afs/sph.umich.edu/system/skel/sys.xsession
      This script sets up some environment variables needed for X-Windows and opens up most of the applications that appear during an X-Windows login. See Figure 5.
    2. /afs/sph.umich.edu/common/skel/sys.common
      Similar function as file 1 above.
    3. ~/.xsession
      See Figure 6. This file doesn't do much except run file 1 above. Users can customize this file to start extra programs during an X-Windows login.

Which of these files can the user customize?

  • The user can customize any file found in their ~/Public directory.
  • Be sure not to remove the portions near the top of any of the files which run the global login or configuration files (see the example files in the figures).
  • SPH users generally customize the .cshrc file rather than the .login file since the .login is not always used.
  • Users usually set the PRINTER environment variable and add some shell aliases for commonly used tasks.
  • For X-Windows users, extra commands can be added to the ~/.xsession file to change what pops up when the user initially logs in. Most changes should be added after the line that calls sys.xsession but before the $STOP_HERE line. See the ~/.xsession file for more details.
  • The login files are plain text files which can be edited with any text editor (e.g. vi, emacs, pico).
  • Be sure not the disturb the symbolic link (see man ln) that connects the login files to your Public directory, e.g., ~/Public/.cshrc to ~/.cshrc. It is okay to edit either ~/.cshrc or ~/Public/.cshrc since both point to the same file.
  • A mistake in any of these files could prevent a user from logging in. It is always a good idea to make a copy of the original file before you make any changes.

What to do if a customization prevents a successful login

  • You can avoid this problem completely if you test your changes without logging out of your current session. If you are running X-Windows, you can open up a new xterm to test changes to your ~/.cshrc file. You can also telnet to another SPH machine without logging out of your current session to test changes to you ~/.cshrc or ~/.login. If the login fails with these methods, you won't be stuck since you never logged out of your current session.
  • If bad login files are keeping you from logging in, you can send a help request to sph.help@umich.edu (e.g. send it via the web form at http://www.sph.umich.edu/computing/forms/help_request.html from a friend's machine). The SPH Computing Services staff will "redot" your files which means that they will rename your current files to something to get them out of the way and then install new files in your home directory.
  • If this happens on a weekend and you must be up and running immediately, you can try to copy the file via FTP to a PC for fixing:
    1. ftp to any UNIX machine from a PC,
    2. be sure that the transfer mode is ASCII,
    3. change directory to your Public directory,
    4. pull down the bad login file (e.g. using the ftp get command),
    5. modify it on your PC (e.g. using Windows Notepad -- remember that this is a plain text file so be careful if you use MS Word to edit the file), and
    6. send (the ftp put command) it back to UNIX (again, in the Public directory -- be sure that the name is correct when you are done).

Figure 1: /afs/sph.umich.edu/common/skel/sys.cshrc

The file listed below has been edited from the version installed at SPH.

#!/bin/csh
#
# System-wide .cshrc file

# Path guidelines:
# - afs path up front
# - local dirs near front
# - X11 near back, openwin at very back
# - /usr/ucb, /usr/ccs near back
# - prefer MANPATH here rather than .login because xterms may not have
#   login shells -- JDA 950629
# - Our Keysymdb is modified for SPH to work with SAS and so is
#   pointed to here

set path=($path /usr/local/bin)
set os=`uname`
set osversion=`uname -r`
if ($os == ULTRIX-32) set os=ULTRIX
if ($os == SunOS && $osversion == 5.5) set os=SOLARIS
if ($os == SunOS && $osversion == 5.5.1) set os=SOLARIS

umask 022
set history = 40
set savehist = 40
# unset savehist                  # Disable .history creation
set filec

### The command search path must be different for different platforms

### Sun SunOS 4.1.x
if ( $os == SunOS ) then
    set path=(/usr/local/bin /usr/afsws/bin /usr/afs/bin \
              /usr/sph/bin /usr/sph/X11R5/bin /usr/ucb \
              /bin /usr/bin /usr/etc /etc /usr/sph/bmdp/bin \
              /usr/sph/wp60/wpbin .) 
    setenv LD_LIBRARY_PATH /usr/lib:/usr/sph/f77/SC1.0:/usr/sph/nag/nagfl15df:/usr/sph/X11R5/lib:/usr/sph/lib:/usr/openwin/lib
    setenv OPENWINHOME /usr/openwin
    setenv TERMINFO /usr/share/lib/terminfo
    if ($?prompt) then
         setenv MANPATH /usr/sph/man:/usr/sph/generic/man:/usr/man:/usr/openwin/man:/usr/sph/X11/man:/usr/share/man
         setenv XKEYSYMDB /usr/sph/lib/XKeysymDB
         stty erase ^H
    endif
 
### Sun Solaris 2.5.1
else if ( $os == SOLARIS ) then
    set path=(/usr/local/bin /usr/sph/bin /usr/bin /usr/afs/bin \
              /usr/sph/devpro_v5n1/SUNWspro/bin /usr/ucb /usr/openwin/bin \
              /usr/sph/X11/bin /usr/ccs/bin /usr/sbin .)

    setenv LD_LIBRARY_PATH /usr/lib:/usr/sph/X11/lib:/usr/sph/lib:/usr/dt/lib:/usr/sph/devpro_v5n1/SUNWspro/lib

    if ( -d /usr/openwin/bin ) then
        # set path=($path /usr/openwin/bin)
        setenv OPENWINHOME /usr/openwin
        setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/openwin/lib"
    else
        set path=($path /usr/sph/openwin/bin)
        setenv OPENWINHOME /usr/sph/openwin
        setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/sph/openwin/lib"
    endif

    alias ps 'ps -o ruser,pid,pcpu,pmem,osz,vsz,nice,s,stime,time,args'

    if ($?prompt) then
         setenv MANPATH /usr/sph/man:/usr/share/man:/usr/openwin/man
         setenv XKEYSYMDB /usr/sph/lib/XKeysymDB
         stty erase ^H
    endif    

    setenv GR_HOME /usr/sph/xmgr-412

endif

### Set path for user's bin directory if they have one (except for root)
if ( ( -d ~/bin ) && ( ~/bin != //bin ) ) then
        set path=(~/bin $path)
endif

### Set system-wide shell variables

if ($?prompt) then

     set notify history=50 prompt="`/bin/hostname | sed 's/\..*//'`% "
     unset autologout
     setenv NNTPSERVER news.itd.umich.edu
     setenv SHOME /usr/sph/splus-3.4
     setenv WWW_HOME http://www.sph.umich.edu/

     # From Gebert (no good here unless modified):
     #setenv %D:/usr/X11R6/lib/X11/%T/%N%S:/usr/local/lib/X11/%T/%N%S

     # Set NLS dir for netscape and backward compatability with R5 apps
     setenv XNLSPATH /usr/sph/X11/lib/X11/nls

     setenv XLOCALEDIR /usr/sph/X11/lib/X11/locale

# Set system-wide command aliases

     alias rm  rm -i
     alias mv  mv -i
     alias cp  cp -i
     alias j jobs
     alias h history
     #alias ls ls -F
     alias cd 'cd \!*;echo $cwd'

     ### Jeff's "gotta-have" aliases
     if ( $os == SunOS ) then
        alias psg 'ps -augwx | egrep '
     else
        alias psg 'ps -ef | egrep '
     endif
     alias dir ls -alg
     alias catmac "tr '\015' '\012' <"
     alias catdos "tr -d '\015' <"
     alias ud 'telnet totalrecall.rs.itd.umich.edu 9501'

    if ( $os == SOLARIS ) then
        setenv TEXMF /usr/sph/tetex/texmf
    endif
endif

Figure 2: ~/.cshrc

#!/bin/csh

###############################################################################
#  This section determines which campus organization has configured the system.

if ( -e /usr/vice/etc/ThisCell ) then
     set OURCELL=`cat /usr/vice/etc/ThisCell`
else
     set OURCELL=sph.umich.edu
endif

#  The next section sources a system-wide setup file.
#  REMOVE THIS ONLY "AT YOUR OWN RISK!"

if ($OURCELL == "sph.umich.edu") then
     source /afs/sph.umich.edu/common/skel/sys.cshrc
else
     source /afs/umich.edu/group/generic/defaults/sys.cshrc
endif

###############################################################################
#  ADD YOUR OWN CUSTOMIZATIONS HERE:
#
setenv BMDP_DIR /usr/sph/bmdp


Figure 3: /afs/sph.umich.edu/common/skel/sys.login

The file listed below has been edited from the version installed at SPH.

# System-wide .login file
#
# Original version created by vishy, 31 Oct 1994.
# Modified regularly since then.

### Set a vendor/os identifier

set os=`uname`
set osversion=`uname -r`
if ($os == ULTRIX-32) set os=ULTRIX
if ($os == SunOS && $osversion == 5.5) set os=SOLARIS
if ($os == SunOS && $osversion == 5.5.1) set os=SOLARIS

### Set up terminal

if ( $?DMLOGIN ) then
     set term=apollo
else
     if ( ! $?term ) set term
endif

set noglob ; eval `tset -I -Q -s` ; unset noglob

# Carry out login-time tasks

if ( $?prompt ) then
        set host=`hostname | awk -F"." '{print $1}'`
        if ( -f /afs/sph.umich.edu/common/announce/daily.mesg ) then
            /bin/cat /afs/sph.umich.edu/common/announce/daily.mesg
        endif

        (/usr/afs/bin/tokens | grep Expires | grep sph.umich.edu >&/dev/null)
        if ($status && ($os != DomainOS)) then
                cat <<EOF

*******************************************************************************
You are not currently authenticated to AFS.  Many commands and applications
will not operate correctly unless you perform an AFS authentication using the
"kinit" and "aklog" commands.
*******************************************************************************

EOF
        endif
endif


Figure 4: ~/.login

#!/bin/csh

###############################################################################
#  This section determines which campus organization configured the system.

if ( -e /usr/vice/etc/ThisCell ) then
     set OURCELL=`cat /usr/vice/etc/ThisCell`
else
     set OURCELL=sph.umich.edu
endif

#  The next section sources a system-wide setup file.
#  REMOVE THIS ONLY "AT YOUR OWN RISK!"

if ($OURCELL == "sph.umich.edu") then
     source /afs/sph.umich.edu/common/skel/sys.login
else
     source /afs/umich.edu/group/generic/defaults/sys.login
endif

###############################################################################
#  ADD YOUR OWN CUSTOMIZATIONS HERE:

Figure 5: /afs/sph.umich.edu/system/skel/sys.xsession

The file listed below has been edited from the version installed at SPH.

#!/bin/csh
#
# System .xsession file used by X-windows
#
# ****WARNING****
#  This file, as is, will not stand alone because it merely sets the STOP_HERE
#  variable and does not execute it.  If you wish to copy this file to
#  ~/.xsession for modification, you must either place $STOP_HERE at the end,
#  or actually exec a program instead of setting the STOP_HERE variable.
# ***************

set OS=`uname`
set osversion=`uname -r`
if ($OS == SunOS && $osversion == 5.5) set OS=SOLARIS
if ($OS == SunOS && $osversion == 5.5.1) set OS=SOLARIS

if (-f /afs/sph.umich.edu/common/skel/sys.common) source /afs/sph.umich.edu/common/skel/sys.common

if ( $OS == SOLARIS ) then
   set MWM="/usr/sph/X11/bin/mwm"
   set TWM="/usr/contrib/bin/X11/twm"
   set WM=$MWM
   set XTERM="/usr/openwin/bin/xterm"
   set XCONSOLE="/usr/openwin/bin/xconsole"
   set XCLOCK="/usr/openwin/bin/xclock"
   set XSETROOT="/usr/openwin/bin/xsetroot"

else if ( $OS == SunOS ) then
   set MWM="/usr/sph/X11R5/bin/mwm"
   set TWM="/usr/sph/X11R5/bin/twm"
   set WM=$MWM
   set XTERM="/usr/sph/X11/bin/xterm"
   set XCONSOLE="/usr/sph/X11R5/bin/xconsole"
   set XCLOCK="/usr/sph/X11R5/bin/xclock"
   set XSETROOT="/usr/sph/X11R5/bin/xsetroot"

else
   set MWM="/usr/bin/X11/mwm"
   set TWM="/usr/bin/X11/twm"
   set WM=$MWM
   set XTERM="/usr/bin/X11/xterm"
   set XCONSOLE="/usr/bin/X11/xconsole"
   set XCLOCK="/usr/bin/X11/xclock"
   set XSETROOT="/usr/bin/X11/xsetroot"

endif

set XCONSOLE_OPTIONS="-exitOnFail"

set STOP_HERE="exec /usr/sph/X11/bin/xlogout -geometry +0+0 -iconic"    

# Turn off key click
xset -c
xhost +`hostname`

#
# Should only have machine dependencies in switch
#
switch ($OS) 

case SunOS:
        xmodmap -e "keysym F19 = Find"
        xmodmap -e "keycode 27 = Up"
        xmodmap -e "keycode 31 = Left"
        xmodmap -e "keycode 34 = Down"
        xmodmap -e "keycode 35 = Right"
        xmodmap -e "keycode 130 = F35"
        xmodmap -e "keycode 103 = F29"
        xmodmap -e "keycode 59 = F27"
#       xmodmap -e "keycode 81 = R13"
        echo "Xterm*ttyModes: erase ^?" | xrdb -merge
#       xmodmap ~/.xmodmaprc
        breaksw

case SOLARIS:
        xmodmap -e "keysym F19 = Find"
        xmodmap -e "keycode 130 = F35"
        xmodmap -e "keycode 103 = F29"
        xmodmap -e "keycode 59 = F27"
        echo "Xterm*ttyModes: erase ^?" | xrdb -merge
        breaksw

default:
        set WM=$MWM
        breaksw
endsw


#
# This loads .Xresources file in home dir and any of the SPH Resources
#
/usr/sph/X11/bin/loadxres

#
# Now start up the standard clients.  It is possible to keep particular clients
# from starting by setting an environmental variable in your own .xsession 
# file.  For example if you didn't want xclock to come up then just put the
# following line into your .xsession file:
#
#       setenv NO_XCLOCK 1
#
# Note1: Don't include the "#".
# Note2: This line must come before the following line:
#
# source /usr/local/skel/sys.xsession
#
 
if (! $?NO_XCONSOLE && -f $XCONSOLE) then
        if ($?XCONSOLE_OPTIONS) then
                $XCONSOLE $XCONSOLE_OPTIONS -iconic &
        else
                $XCONSOLE -iconic &
        endif
endif

if (! $?NO_XSETROOT && -f $XSETROOT) then
        $XSETROOT -solid dimgrey
endif
                                     
if (! $?NO_WM && -f $WM) then
#       $WM >& /dev/console &        
        $WM &
endif

if (! $?NO_XTERM && -f $XTERM) then
        $XTERM -ls -n $NODENAME -geometry 80x24+40+50 &
endif

if (! $?NO_XCLOCK && -f $XCLOCK) then
        $XCLOCK -geometry 108x113-0+0 &
endif

Figure 6: ~/.xsession

#!/bin/csh

# -----------------------------------------------------------------------------
# The following line (beginning with the word "source") causes all of the 
# standard CAEN applications (xclock, xman, etc.) to be started.  If you take 
# it out, you will no longer get the standard CAEN login environment on CAEN's 
# X workstations.  However, you may wish to do so anyway in order to customize 
# your login.  Do this at your own risk.  If you *do* remove it, make sure that
# you either set the STOP_HERE variable to something which will not terminate, 
# or replace the last line of this script to do something that won't terminate.
# An example of setting the STOP_HERE variable might be:
#
#      set STOP_HERE="exec xterm -C -T Console -n Console -iconic"
#
# When this script terminates, you will be logged out.  The STOP_HERE variable
# is used to prevent the script from terminating.
# -----------------------------------------------------------------------------

source /afs/sph.umich.edu/common/skel/sys.xsession

# -----------------------------------------------------------------------------
# Place any additions to the standard login sequence here, below this line,
# and above the next set of comments.
# -----------------------------------------------------------------------------
  


# -----------------------------------------------------------------------------
# The following line (which says "$STOP_HERE") must be left here in order for 
# you to remain logged in during your session.  The "source" line at the top of
# this file defines STOP_HERE as a command which will keep you logged in.
# -----------------------------------------------------------------------------

$STOP_HERE