Troubleshooting environment configurations (2.214.8)

Revision: $Revision: 1.5 $

A candidate should be able to identify common local system and user environment configuration issues and common repair techniques.

Key files, terms and utilities include:

/etc/inittab
/sbin/init
/etc/passwd
/etc/shadow
/etc/group
/etc/profile
/etc/rc.local or /etc/rc.boot
/usr/sbin/cron
/usr/bin/crontab
/var/spool/cron/crontabs/
/etc/`shell_name`.conf
/etc/login.defs
/etc/syslog.conf

Troubleshooting /etc/inittab and /sbin/init

The program /sbin/init reads the file /etc/inittab. See the section called “ What happens next, what does /sbin/init do? ” for a detailed description of the boot process.

If a process isn't running after booting the system, check this file for errors. Then find out what the default runlevel is and check the the /etc/rc?.d/ directory for start/stop scripts.

To get an idea what kind of problems can occur if something is not configured correctly in /etc/inittab, have a look at the file and you'll see things like:

  • The default runlevel. This is the runlevel the system will be in when the boot stage is completed.

  • Scripts to run at boottime. These are the scripts in the directory /etc/rcS.d.

  • What to do if CTRL+ALT+DEL is pressed. So, if you don't want to have the system respond with a reboot to this famous key combination, you can change this behavior here.

  • The number of terminals (Alt+F1...Alt+Fn) that can be invoked by pressing one of the before mentioned key combinations.

  • Getty's on modem lines. A well known message is one of the form: Id ttyS3 respawning too fast: disabled for 5 minutes.

    The Modem-HOWTO on www.linuxdoc.org describes this as follows:

    The line mentioned, in this case ttyS3, causes the problem. Make sure the syntax for this line is correct and that the device (ttyS3) exists and can be found. If the modem has negated CD and getty opens the port, you'll get this error message since negated CD will kill getty. Then getty will respawn only to be killed again, etc. Thus it respawns over and over (too fast). It seems that if the cable to the modem is disconnected or you have the wrong serial port, it's just like CD is negated. All this can occur when your modem is chatting with getty. Make sure your modem is configured correctly. Look at AT commands E and Q.

Troubleshooting authorisation problems

The files involved are /etc/passwd, /etc/shadow and /etc/group.

If a user can't login or gets the wrong shell, chances are the problem is located in /etc/passwd or /etc/shadow. These kind of problems often occurs if someone has been editing the files manually instead of using one of the system tools such as adduser, useradd, deluser, userdel.

Suppose, for example, that a user gets the following result when issuing the command ls -l:

home# ls -l
total 8
dr-xr-xr-x    6 root     0            1024 Dec  6 19:07 ftp
drwxr-xr-x    6 www-data 33           1024 Oct  8 17:18 omproject
drwxr-xr-x    5 piet     1003         1024 Dec  6 23:34 piet
drwxr-xr-x    3 rc564    1001         1024 Dec  4 19:37 rc564
drwxr-xr-x    2 secofr   400          1024 Dec 17 15:26 secofr
drwxr-sr-x   38 willem   1000         3072 Feb  5 09:48 willem
      

Obviously, something has gone wrong: there are group numbers in the result instead of group names as it should be:

dr-xr-xr-x    6 root     root         1024 Dec  6 19:07 ftp
drwxr-xr-x    6 www-data www-data     1024 Oct  8 17:18 omproject
drwxr-xr-x    5 piet     piet         1024 Dec  6 23:34 piet
drwxr-xr-x    3 rc564    rc564        1024 Dec  4 19:37 rc564
drwxr-xr-x    2 secofr   secofr       1024 Dec 17 15:26 secofr
drwxr-sr-x   38 willem   willem       3072 Feb  5 09:48 willem
      

The problem lies in /etc/group which is used to replace the group number by the group name. The group is probably not defined in /etc/group.

Troubleshooting /etc/profile

Here you'll often find the system-wide variable definitions such as PATH, umask and the prompt. Typical problems that can be the result of an error in /etc/profile can be commands that can't be found (due to a wrong PATH) and new files that are created with the wrong permissions (due to an erroneous umask).

Troubleshooting /etc/rc.local or /etc/rc.boot

This is not used anymore as far as I know. Entries that were in these files are know scripts in /etc/rcS.d which should symbolically link to scripts in /etc/init.d as is the case with all the other runlevels.

Troubleshooting cron processes

Cron is responsible for the running of scheduled processes. Each individual user can have his own crontab. If a user can't get his scheduled job to run, the most common causes for this are that the user lacks the authorization to run the command in question or the user lacks the authorization to use cron. The latter is the case if a file /etc/cron.allow exists and the user is not mentioned in that file or if the file /etc/cron.deny exists and the user is mentioned in that file.

The files /var/spool/crontabs/<username> which are the user specific cron files, should not be edited directly, use crontab -e instead.

Troubleshooting /etc/`shell_name`.conf

This has already been described in the section called “Login shells”.

Troubleshooting /etc/login.defs

This has already been described in the section called “Shell startup environment”.

Troubleshooting /etc/syslog.conf

This had already been described in the section called “System logging (for your reference)”.

Copyright Snow B.V. The Netherlands