Administration
  Home arrow Administration arrow Page 6 - Kernel, Cron, and User Administration,...
The Best Selling PC Migration Utility.
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Kernel, Cron, and User Administration, Part 2
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2004-10-06

    Table of Contents:
  • Kernel, Cron, and User Administration, Part 2
  • Updating Your Boot Loader
  • The Kernel Source Tree and Documentation
  • The Kernel RPMs
  • GUI Kernel Source Management
  • The Linux Kernel tar File
  • Understanding Kernel Configuration Options
  • Compiling and Installing a Custom Kernel
  • The cron and at Systems
  • Setting Up cron for Users
  • Certification Summary
  • Self Test
  • Lab Questions
  • Self Test Answers
  • Lab

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Kernel, Cron, and User Administration, Part 2 - The Linux Kernel tar File
    (Page 6 of 15 )

    Alternatively, you can download the newest kernel from the Linux kernel home page at www.kernel.org. The version numbers are discussed in the next section. Once you have downloaded the kernel source, you will need to properly install it. For our example, we will assume you downloaded linux-2.4.22.tar.gz into the /usr/src/ directory.

    # cd /usr/src
    # mkdir linux-2.4.22
    # rm linux-2.4
    # tar xzvf linux-2.4.22.tar.gz
    # ln -s linux-2.4.22 linux-2.4

    Here we manually created a new directory for the kernel, removed the old link, and then uncompressed the tar.gz file. Then you can link linux-2.4 to the new directory created when you uncompress the tar.gz file.

    ON THE JOB!  Compressed tar files are shown in tar.gz format; they are also known as “tarballs.”

    Recompiling a Kernel

    Fortunately, references to recompiling the Linux kernel have been removed from the Red Hat exam requirements. However, RHCEs in the real world are expected to know how to perform high-level tasks such as optimizing and recompiling the Linux kernel.

    In this section, we’ll start by looking at the kernel configuration file. Then we’ll proceed with the different tools available to edit the kernel configuration. Finally, I’ll show you the commands needed to compile your new configuration into the kernel, and show you the files this adds to the /boot directory and the settings it adds to the boot loader.

    EXAM WATCH!  References to recompiling the Linux kernel have been removed from the Red Hat Exam Prep guide and associated Red Hat prep courses. However, good Linux administrators know how to recompile the Linux kernel.

    The Kernel Configuration Scripts

    After you’ve configured a kernel once, the configuration information is stored in a hidden file, /usr/src/linux-2.4/.config. It is structured as a listing of variables. Here are some entries from the .config file:

    CONFIG_NETDEVICES=y
    CONFIG_DUMMY=m
    # CONFIG_SUNLANCE is not set

    As you can see, there are three main types of variables in this file. The first command here compiles in direct support, the second entry compiles support as a module (the “m”), and the third is commented out, and is therefore not compiled into the kernel at all. You should never have to edit this file directly, as there are easier ways to configure your kernel.

    Move to the directory with your kernel source files. If you’ve installed the RHEL 3 kernel-source RPM, you can use the /usr/src/linux-2.4 directory. If you’ve installed the latest kernel from www.kernel.org, it may be in the /usr/src/linux directory. Three tools can help you configure the kernel configuration file: make config, make menuconfig, and make xconfig.

    Back Up Your Configuration

    The default configuration for your current Linux kernel is stored in the /boot directory. For the default RHEL 3 system, it’s stored in the config-2.4.21-4.EL file. Back up this file on another location such as a rescue floppy so that you can restore your current kernel configuration if all else fails.

    You can use your current configuration as a baseline; the Linux kernel configuration tools will start with these settings. To do so with the current kernel, run the following command:

    # cp /boot/config-2.4.21-4.EL /usr/src/linux-2.4/.config

    Alternatively, there are a number of standard configuration files in the /usr/src/linux-2.4 /configs directory. If you want to start with one of these files, use the config file that corresponds most closely to your hardware. You can set that as the starting point for your configuration by copying it to the /usr/src/linux-2.4/.config file.

    ON THE JOB!  There is a default kernel configuration file in the /usr/src/linux-2.4/configs directory. It’s associated with your CPU hardware; for example, if you have an Athlon CPU, you’ll find it in a file named kernel-2.4.21-athlon.config. If your kernel version is different, the number changes accordingly.

    make config

    Once you’re in the directory with the kernel source files (/usr/src/linux-2.4), you can call a simple script to configure a new kernel with the following command:

    # make config

    This script will prompt you through your different options. Figure 5-11 shows an excerpt from the output for this script.

    FIGURE 5-11  Questions from the make config utility

    Make Config

    Here the kernel variables are listed in parentheses and the possible answers are in brackets. The default answer is in capital letters. If you type in a ?, you will see a help page explaining this option. Since several hundred questions are associated with this script, most administrators use one of the other two scripts to manage their Linux kernels.

    make menuconfig

    A nicer way to create the .config file is to use the make menuconfig command. This requires the ncurses RPM package. This opens a text-based, menu-driven system that classifies and organizes the changes that you can make to a kernel. Figure 5-12 illustrates the main menu associated with this command.

    The nice thing about menuconfig is that it works very nicely over a remote text connection from other Linux computers (or perhaps that is dangerous!). Also, options appear at the bottom of the menu to load or save the configuration file from a different location.

    Figure 5-12  The make menuconfig configuration menu

    make menuconfig

    make xconfig

    The other way to make changes to the kernel is to use the X Window System. You can generate a graphical menu system to configure your kernel by running the make xconfig command. Figure 5-13 shows the xconfig main menu. You can also use xconfig to load or save the configuration from the file of your choice.

    While this menu may look slightly different in different Linux distributions, the principles and basic options remain fairly constant. Each of the Kernel Configuration Options discussed on the following pages are presented for completeness. It is important for a Linux administrator to have a detailed understanding of the hows and whys about reconfiguring and recompiling the kernel.

    Figure 5-13  The make xconfig configuration menu

    make xconfig

    This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.

    More Administration Articles
    More By McGraw-Hill/Osborne


     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway