≡ Menu

rhel 5

Q. I'm getting error that read as follows while installing the RHEL / CentOS Linux Directory Server on the Red Hat Enterprise Linux system.

Failure (4322): Configuration initialization failed error when

How do I fix this issue?
[click to continue…]

How do I use yum command to update and patch my Red hat Enterprise Linux / CentOS Linux version 5.x server via RHN / Internet? Can I use up2date command under RHEL 5?
[click to continue…]

Q. How can I create mpath devices for partitions under CentOS Linux 5?
[click to continue…]

Q. How do I install Linux kernel source code and headers under RHEL 5 or CentOS 5 Linux operating system?

A. Both CentOS and RHEL 5 includes following packages:

a) Kernel-headers : It includes the C header files that specify the interface between the Linux kernel and userspace libraries and programs. The header files define structures and constants that are needed for building most standard programs and are also needed for rebuilding the glibc package.

b) kernel-devel : This package provides kernel headers and makefiles sufficient to build modules against the kernel package.

c) Actual kernel source code : You can always download actual source code here. Look for kernel*.rpm file.

Rhel / CentOS 5 install kernel headers

Use yum command as follows:
# yum install kernel-devel Kernel-headers

Install kernel source code

Type the command as follows:
# cd /tmp
# wget ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-8.1.8.el5.src.rpm
# rpm -ivh kernel-2.6.18-8.1.8.el5.src.rpm

Note change version number as per your current kernel.

For recompiling or adding a new module or device driver you just need kernel-devel and Kernel-headers packages. To rebuilt kernel rpm goto /usr/src/redhat/SPECS directory, modify kernel spec file and use rpmbuild command to rebuild rhel/centos kernel rpm.

Q. I’m using Debian Linux for last 4 years. I’m not able to find out update-rc.d like command ( install and remove System-V style init script links) on Redhat enterprise Linux (RHEL 5). Can you specify equivalent command for the same task?

A. update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name. These links are run by init when it changes runlevels; they are generally used to start and stop system services such as daemons. runlevel is one of the runlevels supported by init, namely, 0123456789S, and NN is the two-digit sequence number that determines where in the sequence init will run the scripts. Please note that this program was designed for use in package maintainer scripts and, accordingly, has only the very limited functionality required by such scripts. System administrators are not encouraged to use update-rc.d to manage runlevels. They should edit the links directly or use runlevel editors such as sysv-rc-conf and bum instead.

Under RHEL / CentOS you use command called ntsysv or chkconfig.

Redhat ntsysv tool

ntsysv is a simple interface for configuring runlevel services which are also configurable through chkconfig. By default, it configures the current runlevel. Just type ntsysv and select service you want to run:
# ntsysv
Sysv Service managment tool
(Fig.01: ntsysv in action under Red Hat Linux)

Redhat chkconfig tool

chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories. chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service.

Add service called foo

This option adds a new service for management by chkconfig:
# chkconfig --add foo

Delete service called foo

The service is removed from chkconfig management, and any symbolic links in /etc/rc[0-6].d which pertain to it are removed:
# chkconfig --del foo

List status for foo service

This option lists all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel.
# chkconfig --list foo

Turn on or off services:
# chkconfig foo on
# chkconfig foo off
# chkconfig --level 2 foo on

Note that --level 35 specifies run levels 3 and 5, so following will turn on httpd service for 3 and 5 only:
# chkconfig --level 35 httpd on

Q. How do I backup files and database for the Red Hat Enterprise Linux / CentOS Linux? Currently I’ve MySQL server running on CentOS 5 and Web server and file server using RHEL 5. How do I backup all these servers?

A. Regular backup is an essential for Linux system. You can take backup on
=> Tape
=> NAS Server
=> DVD
=> Network server etc

Implementing a backup policy that includes rotating backup media and keeping copies of backup media offsite is the most reliable way of minimizing damage. See following resources on our site for more information including commands and shell scripts:

  1. Perform backups for the Linux operating system
  2. How to backup MySQL databases, web server files to a FTP server automatically
  3. Howto Backup PostgreSQL Databases
  4. All backup shell scripts

Q. Can you tell me how do I patch and update everything on my Redhat Enterprise Linux server 5?

A. Both RHEL 5 and CentOS 5 use yum command, which is an interactive, automated update program which can be used for maintaining systems using rpm.

To upgrade server and apply all security patches, pass update option to yum command. It will update every currently installed package. If one or more packages are specified, Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied. If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.

Task: Redhat / CentOS upgrade server and apply all security patches

In short type the following command, as the root user:
# yum update
OR if sudo is configured:
$ sudo yum update
Sample output:

Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
rhel-x86_64-server-vt-5   100% |=========================| 1.2 kB    00:00
rhel-x86_64-server-5      100% |=========================| 1.2 kB    00:00
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package kernel-devel.x86_64 0:2.6.18-8.1.8.el5 set to be installed
---> Package kernel-headers.x86_64 0:2.6.18-8.1.8.el5 set to be updated
---> Package kernel.x86_64 0:2.6.18-8.1.8.el5 set to be installed
--> Running transaction check
--> Populating transaction set with selected packages. Please wait.
---> Package kernel-devel.x86_64 0:2.6.18-8.el5 set to be erased
---> Package kernel.x86_64 0:2.6.18-8.el5 set to be erased
--> Running transaction check
Dependencies Resolved
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 kernel                  x86_64     2.6.18-8.1.8.el5  rhel-x86_64-server-5   14 M
 kernel-devel            x86_64     2.6.18-8.1.8.el5  rhel-x86_64-server-5  4.7 M
Updating:
 kernel-headers          x86_64     2.6.18-8.1.8.el5  rhel-x86_64-server-5  762 k
Removing:
 kernel                  x86_64     2.6.18-8.el5     installed          72 M
 kernel-devel            x86_64     2.6.18-8.el5     installed          15 M
Transaction Summary
=============================================================================
Install      2 Package(s)
Update       1 Package(s)
Remove       2 Package(s)
Total download size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): kernel-devel-2.6.1 100% |=========================| 4.7 MB    00:04
(2/3): kernel-headers-2.6 100% |=========================| 762 kB    00:00
(3/3): kernel-2.6.18-8.1. 100% |=========================|  14 MB    00:12
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: kernel-devel                 ######################### [1/6]
  Updating  : kernel-headers               ######################### [2/6]
  Installing: kernel                       ######################### [3/6]
  Cleanup   : kernel-headers               ######################### [4/6]
  Cleanup   : kernel-devel                 ######################### [5/6]
  Cleanup   : kernel                       ######################### [6/6]
Removed: kernel.x86_64 0:2.6.18-8.el5 kernel-devel.x86_64 0:2.6.18-8.el5
Installed: kernel.x86_64 0:2.6.18-8.1.8.el5 kernel-devel.x86_64 0:2.6.18-8.1.8.el5
Updated: kernel-headers.x86_64 0:2.6.18-8.1.8.el5
Complete!

A note for RHEL 4 user

You need to use up2date command:
# up2date -u