Many Unix/Linux commands have associated with them initialization files. These are usually plain text files, that end-user can modify to suit their needs with just a simple text editor. So it is in the OS itself, where there are many initialization files stored on the hosts.
Often these files have names that incorporate the characters "rc", which stand for "runcom", which itself is an abbreviation of "run commands" or "run control" or "run configure," according to posts on StackExchange, Wikipedia, and other sites.
An "rc" file then is a file of commands used to configure a software program when it first starts to run. Unix/Linux use rc files as the OS starts to run following boot-up. The shells are programs that provide the basic user interface for the OS. They can also be considered CLIs
(Command-Line-Interfaces). Their primary purpose is to allow humans to control and command the computer in its work, and for the computer to give its output to the humans who tend it.
For the purposes of this discussion, we will divide the world of Unix/Linux shell programs into two camps: (1) is sh (bourne sh, posix sh, bash, ksh, and others) and (2) is csh (csh, tcsh, and others). When a shell starts, it reads its native configuration files. sh shells read profile or .profile files in the system /etc
directory, or the user's home directory. Csh reads login or .login files found in the same locations as the (.)profile files. They often contain very similar information, but they often have marked differences, too.
One place where this difference shows up is in how scripts are interpreted by the different shells. The differences are widespread enough to make it very difficult to write a single script that will run correctly under both shells. NetSol has developed a technique, a system of script functions (available only under sh) and aliases (available in both shells), that allow carefully written scripts to run correctly under either shell. Files that contain these limited scripts are tagged msirc files, and bear the file extension '.msirc'.
Files of this type are characterized as "shell neutral". Msirc files are not used to implement LeasePak functions, but instead are used to provide a single source for configuration of both types of shells. The run-time configuration of LeasePak shells is accomplished using this form of scripting.
When a Unix user logs onto a LeasePak server, his or her shell will execute the .login file in the user's home directory or the .profile file, etc. For LeasePak, the start-up file must set a few environmental variables and then start running a series of scripts, some named "*rc", which will configure the shell environment for LeasePak. This shell environment gives its user the ability to access LeasePak utilities, and to examine files and directories containing LeasePak data, and to execute allowed system utilities.
The shell start-up files are the ones mandated by the version of the operating system and the shell program the user uses. Primarily, these are .profile and .login, but include (for csh shells) .cshrc, .history, and any others that the shell, or OS, start-up files are programmed to read. Thus, when a shell start-up file reads a LeasePak start-up file, then that shell is considered "logged into LeasePak", and "has a LeasePak environment", and "is configured for LeasePak."
Use
vi
to modify a user's
shell start-up file to configure his or her account for LeasePak upon logging in.
Below are the contents of the two template Unix start-up files provided in $live/lib
. These are truly minimal start-up files, and probably not adequate in and of themselves to fully provision a user for anything but accessing LeasePak at the shell level; they are adequate for that task.
Below is the template file sample.login
. It is intended for use by users who are using the csh
or tcsh
command shells:
###############################################################
# NetSol Sample .login file
# $Revision: 6.2.0.2 $ $Date: 2011/09/11 00:26:42 $
###############################################################
# Set up the default search paths:
set path=( $path . )
#set up the terminal
eval `tset -s -Q -m ':?vt100' `
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tostop
tabs
alias cd 'cd \!*; set prompt="[${LOGNAME}:${cwd}] "'
cd $cwd
# Source user's .lplogin file to set up LEASEPAK/UX environment
if ( -f $HOME/.lplogin ) then
source $HOME/.lplogin
else
echo "Warning: You don't have a .lplogin file"
endif
Below is the template file sample.profile
. It is intended for use by users who are using the sh
, ksh
, or bash
command shells:
###############################################################
# NetSol Sample .profile file
# $Revision: 6.2.0.3 $ $Date: 2011/09/11 00:31:49 $
###############################################################
# Set up the terminal:
eval ` tset -s -Q -m ':?vt100' `
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs
# Set up the search paths:
PATH=$PATH:.
# Set up the shell variables:
EDITOR=vi
export EDITOR
# Source user's .lpprofile file to set up LEASEPAK/UX environment
if [ -f $HOME/.lpprofile ] ; then
. $HOME/.lpprofile
else
echo "Warning: You don't have a .lpprofile file!"
fi
In both cases, the sample start-up files set up the user's terminal or terminal emulator, set up a path variable, and set some other environment variables.
They both then check for the existence of a LeasePak start-up file in the user's home directory
, and if found, read it into the shell process, but if not found, print a message to the user advising them that no LeasePak start-up file was found.
CRITICAL NOTE
In Order for LeasePak to Work
The user's environment must assign to the TERM
or term
variable (depending on which shell is in use) a value that is supported by the Queue Manager. See System Requirements Terminal Emulation for more information.
IMPORTANT NOTE
LeasePak Start-up Files
When a LeasePak environment is created using setup_new_env
, two LeasePak start-up files are created: .lplogin
and .lpprofile
. In order for a user shell to be configured for LeasePak, the user's .login
or .profile
file must read in the appropriate one of these LeasePak start-up files. The next section discusses how to make this happen.