UNIX Hints & Hacks |
|||||||||||||||||||||||||||||||||||||
Chapter 5: Account Management |
|
||||||||||||||||||||||||||||||||||||
|
After the login process begins, certain startup files are processed (depending on the login shell that is selected).
Flavors: AT&T, BSD
Shells: ksh, sh
When the Bourne shell is used, the .profile startup file is processed. This file contains all information and settings for the terminal settings, the environment variables, path, and other general settings.
Shell: csh
The C shell uses two separate startup files and a logout file. The .login file sets up all the necessary terminal characteristics along with the environment variables. The .cshrc file sets the path that commands search, global variables (applications, history, and prompt), the umask value, and the user's personal aliases. When the logout process begins, the .logout file is processed. Entries in this file generally clear the screen, send reminder messages, and can run any scripts on leaving the system.
Other shells make use of the similar features. The tcsh shell uses .tcshrc, and bash uses .bashrc to configure all the user control settings. Many of the startup files end in the letters rc (run command), containing a series of commands that are run at the startup of a shell.
Startup files are important to every shell that runs. They set the terminal settings and environment variables so the window manager knows what to do. Without proper startup files, programs might never be located because there is no path to them.
I typically set up two sets of startup files for each environment I work in, and store them in /usr/local/etc. One set is the generic system startups that can be found in the root directory on any flavor. It is the startup files that the account root uses. These are raw untouched startup files that are compatible for anyone to use. When a new user gets an account, I copy duplicates of these files into his or her home directory.
The second set of startup files is customized for the individual environment, not the individual user. These files contain special variable definitions for software licenses, applications, custom path definitions, and aliases that pertain directly to a set of users. An entry is usually made near the bottom of their generic startup files to reference (or source) the customized files.
When this is finished, if a user modifies the startup files on her own to personalize them, she is encouraged to start at the bottom of the files. When the phone rings and the user cannot log in to her account, you can easily comment out her additions and discover what entry is preventing the user from logging into the system.
Man pages:
bash, csh, ksh, sh, tcsh
UNIX Hints & Hacks |
|||||||||||||||||||||||||||||||||||||
Chapter 5: Account Management |
|
||||||||||||||||||||||||||||||||||||
|
© Copyright Macmillan USA. All rights reserved.