Linux configuration notes

Linux configuration notes

Post by Peter Hiscoc » Tue, 15 Mar 1994 00:19:17



The following is a brief note that I generated in the process of
understanding how different configuration files interact.

Comments welcome.

  ------------------------ cut here -----------------------------------------

Linux System Configuration
--------------------------

For the purposes of configuring the system, it is useful to have some
understanding of how a Linux system starts up.
Since Linux is based on SVR4, much of the following (but not all)
derives from the behaviour of that system.

The boot process consists of a number of stages:

- the boot program, init, reads the /etc/inittab file
- the inittab file contains instructions to execute the /etc/rc file
- the /etc/rc file contains instructions to execute the /etc/rc.local file

When first booted, the system runs a binary program, 'init'.
This program reads the text file '/etc/inittab'. The standard
Sys V use of inittab is to provide for a number of startup
scenarios, depending on the situation: booting to single user mode,
booting to multi-user mode, rebooting, and so on. However, under
Linux, this has been simplified.

In this case, the inittab
- starts 'update', a process which periodically runs the filesystem
'sync' command, writing new information to the hard drive.
- using the program 'bootwait', reads the /etc/rc initialization file
(see below).
- starts the 'crond' program, which executes commands at preset
times
- starts 'getty' processes for the various terminals. (This is
where you would make changes to support login by modem,  for example.
If you login as root or su to root, and do a 'ps', you will see
the getty processes listed.)
- handles a shutdown initiated by ctrl-alt-delete

The 'rc' (Run Commands) initialization file contains further instructions
for the boot process. Typically, rc contains a script for initializing
a given variant of the operating system across a number of installations.

The last instruction in the rc script is the command
            /bin/sh /etc/rc.local
This causes the shell program sh (see below) to be executed,
reading the script rc.local. This script is customized for each
individual installation of the operating system. In the case of Linux,
for example, if a backup tape exists one adds a command to install
the ftape driver (for the tape backup unit) to the rc.local script.

The details of the contents of rc and rc.local are described in Chapter 3,
Startup and Shutdown, of reference [1].

User Configuration
------------------
The first user configuration issue is the choice of user shell program,
which determines the syntax of commands and command scripts. The shell is
specified for each user as the last entry in the /etc/passwd file.
For example the entry for user phiscock specifies /bin/sh.

      phiscock:*:405:1:Peter_Hiscocks:/home/phiscock:/bin/sh

(Interestingly, the shell program is simply another program, and if the
user needed only one program, it could be specified instead of /bin/sh.)

A look at the /bin directory (ls -l /bin) shows that sh is linked to
the program 'bash', the Bourne Again SHell).
Another possibility, with the Slackware distribution, is tcsh606, the
expanded c shell.

According to the manual entry for bash, the startup files executed by
the bash shell (in order) are:
      /etc/profile   the system default login shell
      .bash_profile  a user login shell (optional)
      .bash_login    user login shell if .bash_profile not present
      .profile       user login shell if .bash_login not present
      .bashrc        interactive non-login shells
      $ENV           specifies the startup file for non-interactive shells

In the case of Linux, /etc/profile contains the default user configuration
(PATH specification, aliases, environmental variables).

There are no .bash_profile or .bash_login files. Thus it is the .profile
file, in the home directory of the user, that specifies the environment
settings for each individual user.  This is the file to modify to change
history settings, PATH and alias variables.

As currently constituted, there is no .bashrc. If an interactive,
non-login interactive shell required a different environment from
that specified in .profile, then this would presumably be specified
in .bashrc. Similarly, the $ENV specification designates a file that
would be used for non-interactive shells.

references:
      Essential System Administration
      AEleen Frisch
      O'Reilly & Associates
      ISBN 0-937175-80-3

      Unix System V, Release 4 Administration
      Fiedler and Hunter
      Hayden Books
      ISBN 0-672-22810-6

--
Peter Hiscocks                            Phone: (416) 979-5000 Ext 6109
Department of Electrical Engineering      Fax:   (416) 979-5280
Ryerson Polytechnical University, Toronto, Canada

 
 
 

1. Postfix configuration notes

Hi everybody, happy new year!

I'd like to inform you "Postfix configuration notes" are available for
download at the following url:

http://digilander.iol.it/yellowjester/postfix/postfix.html

This a is a structured document based on the information available from
the sample configuration files shipped with postfix, which describes
some configuration parameters for this MTA.

Currently available formats are:
* portable document format (pdf)
* plain ASCII text format (txt)
* doc format compatible with palm (pdb)

On the page, you can also find some configuration templates and links to
external postfix related resources.

Best regards.
Alessandro
--
Alessandro Dotti
Bologna Italy
http://digilander.iol.it/yellowjester/

For email replies:
alessandro.dotti(at)libero.it

##########################################################################

# PLEASE remember a short description of the software and the LOCATION.  #
# This group is archived at http://stump.algebra.com/~cola/              #
##########################################################################

2. Specs for NEC Multisync GS monitor?

3. Mach64 ISA Configuration note

4. Changing the root directory of FTP

5. Lotus Notes Webserver Configuration and Administration Forms not executable

6. What is the command for sun corresponding to mktemp in HP

7. PC Chips M841LR (SiS740 based) RedHat 7.3 Configuration Notes

8. set mutil ip address on one interface?

9. openLDAP/TLS configuration notes

10. Lotus Notes on Linux

11. Note: Util-Linux-2.2 has chfn & chsh problem

12. Linux Speed - please note your opinion