Extra Credit Lab 2: Configuring Multiple Runlevels

Last modified: Sep 12, 2011

The purpose of this lab is to configure your Red Hat Enterprise Linux installation from lab 3 to boot up into any one of four different runlevel states:
  1. Maintenance Mode
  2. Basic Networking Mode
  3. Full Services Mode
  4. Graphical Desktop Mode
You will do this by configuring which services will come up in which runlevels, and by editing the /boot/grub.conf file so that the user can select which mode to boot into.

Part I

Removing unneeded services.
  1. Boot up into single user mode on your Dual VM.
    The following services are not needed on our virtual machines and should be configured to not start up under any runlevel:
    kudzu			cpuspeed	isdn		pcmcia
    irqbalance		mdmonitor	apmd		smartd
    rawdevices		rhnsd		openibd		lm_sensors
    microcode_ctl
  2. To disable these services, run the following command with each of the above named services:
    chkconfig <service> off

Part II

Configuring Runlevels
  1. Runlevel 1 - Maintenance Mode is already minimally configured. Notice the services that are configured to start in runlevel 1 by viewing the directory: /etc/rc.d/rc1.d.
  2. Runlevel 2 - Basic Networking. For this runlevel you must disable the following services from runlevel 2:
    cups,	sendmail,	xfs
    Usse the following command to disable these services from runlevel 2:
    chkconfig --level 2 <service> off
  3. Runlevel 3 - Full Services Mode. Leave as is.
  4. Runlevel 5 - Graphic Desktop Mode. Leave as is.

Part III

Compare the services running under each runlevel.
  1. In single user mode, run the command:
    ps -e | wc -l
    to see how many processes are running. These will be mostly kernel processes/threads.
  2. Now initiate runlevel 2 by typing the command:
    init 2
    After a couple of seconds hit the ENTER key test for the total number of processes running as you did above.
    How do the number of processes compare?
  3. Proceed to runlevel 3: init 3
    How many processes are running now?
  4. Now go to runlevel 5. Log in to the graphical desktop and compare the number of processes running to the other runlevels.

Part IV

Configure the grub.conf Menu
  1. Edit the /boot/grub/grub.conf file and duplicate the 4 lines starting with the key word, title three times.
  2. Leave the first title line exactly as it is; this will boot up into runlevel 5.
  3. The second title section should read "Full Services Mode", and the kernel line should terminate with the number 3 instead of the words: rhgb quiet.
  4. The third title section should read "Basic Networking Mode", and the kernel line should terminate with the number 2 instead of the words: rhgb quiet.
  5. The fourth title section should read "Maintenance Mode", and the kernel line should terminate with the word single instead of the words: rhgb quiet.
  6. Save the file, and reboot the system insuring that your new menu is functional.

To turn in

Create a lab2x file that contains the contents of your grub.conf file and the ls output of the rc1.d, rc2.d, rc3.d and rc5.d directories.
Please label you output so that it makes sense to someone looking at it. Copy this file to opus using the command:

scp lab2x logname@opus.cabrillo.edu:lab2x
Note: logname is your personal account name.

Grading Rubric

4 points for:
a correct listing of each of the runlevel startup directories
1 point for:
a correctly specified grub.conf file.