Flylib.com

Books Software

 
 
 

Chapter 3. System administration

 <  Day Day Up  >  

Chapter 3. System administration

Recognizing that there are many Linux administration guides and most everyday administration tasks are covered by SuSE Administration Guide provided on the distribution CDs, in this chapter we concentrate on a brief introduction to local and cluster system administration. We describe the administration tools on a Linux system and discuss user administration issues, logical volume management and selected network topics. We also describe system update and system backup possibilities.

With or without CSM, a cluster or enterprise environment with more than a single Linux system will challenge an administrator. Administration of many network systems can be just a sum of single system administration tasks, but in this case there will be many perpetual and repeated steps. For effective enterprise system administration, you need tools that will focus these tasks at a single point of control and accomplish them once for the whole cluster.

We will use DHCPD for dynamic address configuration, BIND for name resolution, and LDAP or file distribution for user management. An environment built with these tools remains flexible, and adding new nodes is no additional effort.

We provide step-by-step instruction on how to get these tools running. All the configuration files were tested in our environment and should be able to serve your needs with only minor changes.

 <  Day Day Up  >  
 <  Day Day Up  >  

3.1 The bash shell

The most powerful and flexible administration tool on almost every UNIX-like system is the shell. The standard shell in a SuSE SLES for pSeries 8.0 is the Bourne again shell, or bash. It is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. Most sh scripts can be run by bash without modification.

Command history

The standard history mode on bash is emacs; to view all of the current settings of the shell, issue the set -o command:

# set -o

If you are more comfortable using vi than the emacs mode, use the set -o vi command.

The default history size is 500 entries, but this can be changed by setting the HISTSIZE variable.

Command line history keys are mapped to the arrow keys by default. You can navigate the history by pressing arrow up and arrow down keys. Pressing Ctrl + R allows you to search in history; simply start typing your command and bash will display the first match in the history. You can then continue typing to get other results, or press Ctrl + R again to search backwards according to the characters already given.

Command completion

The bash shell provides command completion, so typing the first letters from a command and pressing the Tab key will give you the choices from all executables in your path .

# cs TAB TAB

csh     csplit

Typing TAB TAB after the executable will show the files in the current directory:

lpar5:/etc/sysconfig/network # vi TAB TAB

config           ifcfg-eth0       ifcfg.template wireless

dhcp             ifcfg-eth0.ORIG  providers

if-down.d        ifcfg-eth1       routes

if-up.d          ifcfg-lo         scripts

The bash configuration files

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. [1]

[1] See man bash

In SuSE SLES, the /etc/profile file should not be changed because it can be overwritten by an update. Global shell customization should be done by editing the /etc/profile.local instead. User scripts should be placed in ~/.bashrc in order to make sure it will be used even if a login shell is not started.

Alternatives to bash

Open source software offers freedom of choice. If you prefer not to use bash, you can choose other shells , such as the following::

  • tcsh - an enhanced but completely compatible version of the Berkeley UNIX C shell, csh. [2]

    [2] See man tcsh and http://www.tcsh.org for more information

  • ksh -a public domain Korn shell. PD-ksh is a clone of the AT&T Korn shell. It currently offers most of the ksh88 features, not much of the ksh93 features, and a number of its own features. [3]

    [3] See man pdksh and http://web.cs.mun.ca/~michael/pdksh/ for more Information

  • zsh - the Z shell. Of the standard shells, zsh most closely resembles ksh, but includes many enhancements. [4]

    [4] See man zsh and http://www.zsh.org/ for more information

  • ash - a version of sh with features similar to those of the System V shell. [5]

    [5] See man ash

  • sash - a standalone shell with built-in commands (used for system recovery and installation).

 <  Day Day Up  >