24
1. BIOS BIOS stands for Basic Input/Output System Performs some system integrity checks Searches, loads, and executes the boot loader program. It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence. Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it. So, in simple terms BIOS loads and executes the MBR boot loader. 2. MBR MBR stands for Master Boot Record. It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda MBR is less than 512 bytes in size. This has three components 1) primary boot loader info in 1st 446 bytes 2) partition table info in next 64 bytes 3) mbr validation check in last 2 bytes. It contains information about GRUB (or LILO in old systems). So, in simple terms MBR loads and executes the GRUB boot loader. 3. GRUB GRUB stands for Grand Unified Bootloader. If you have multiple kernel images installed on your system, you can choose which one to be executed. GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file. GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand filesystem).

Boot Process in Linux

Embed Size (px)

Citation preview

Page 1: Boot Process in Linux

1. BIOS

BIOS stands for Basic Input/Output System Performs some system integrity checks Searches, loads, and executes the boot loader program. It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically

F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence.

Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.

So, in simple terms BIOS loads and executes the MBR boot loader.

2. MBR

MBR stands for Master Boot Record. It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda MBR is less than 512 bytes in size. This has three components 1) primary boot loader

info in 1st 446 bytes 2) partition table info in next 64 bytes 3) mbr validation check in last 2 bytes.

It contains information about GRUB (or LILO in old systems). So, in simple terms MBR loads and executes the GRUB boot loader.

3. GRUB

GRUB stands for Grand Unified Bootloader. If you have multiple kernel images installed on your system, you can choose which one

to be executed. GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it

loads the default kernel image as specified in the grub configuration file. GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t

understand filesystem). Grub configuration file is /boot/grub/grub.conf (/etc/grub.conf is a link to this). The

following is sample grub.conf of CentOS.

#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/boot/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.18-194.el5PAE) root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/ initrd /boot/initrd-2.6.18-194.el5PAE.img

As you notice from the above info, it contains kernel and initrd image. So, in simple terms GRUB just loads and executes Kernel and initrd images.

Page 2: Boot Process in Linux

4. Kernel

Mounts the root file system as specified in the “root=” in grub.conf Kernel executes the /sbin/init program Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID)

of 1. Do a ‘ps -ef | grep init’ and check the pid. initrd stands for Initial RAM Disk. initrd is used by kernel as temporary root file system until kernel is booted and the real

root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.

5. Init

Looks at the /etc/inittab file to decide the Linux run level. Following are the available run levels

o 0 – halto 1 – Single user modeo 2 – Multiuser, without NFSo 3 – Full multiuser modeo 4 – unusedo 5 – X11o 6 – reboot

Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.

Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level If you want to get into trouble, you can set the default run level to 0 or 6. Since you know

what 0 and 6 means, probably you might not do that. Typically you would set the default run level to either 3 or 5.

6. Runlevel programs

When the Linux system is booting up, you might see various services getting started. For example, it might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.

Depending on your default init level setting, the system will execute the programs from one of the following directories.

o Run level 0 – /etc/rc.d/rc0.d/o Run level 1 – /etc/rc.d/rc1.d/o Run level 2 – /etc/rc.d/rc2.d/o Run level 3 – /etc/rc.d/rc3.d/o Run level 4 – /etc/rc.d/rc4.d/o Run level 5 – /etc/rc.d/rc5.d/o Run level 6 – /etc/rc.d/rc6.d/

Please note that there are also symbolic links available for these directory under /etc directly. So, /etc/rc0.d is linked to /etc/rc.d/rc0.d.

Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K.

Page 3: Boot Process in Linux

Programs starts with S are used during startup. S for startup. Programs starts with K are used during shutdown. K for kill. There are numbers right next to S and K in the program names. Those are the sequence

number in which the programs should be started or killed. For example, S12syslog is to start the syslog deamon, which has the sequence number of

12. S80sendmail is to start the sendmail daemon, which has the sequence number of 80. So, syslog program will be started before sendmail.

redhat runs

/etc/rc.d/rc.sysinit script /etc/rc.d/rc3.d/S* scripts

The Linux Boot Process

or What happens before the login prompt

Presented by Kim Oldfield to the Linux Users of Victoria on 7 November 2001.

This talk is based on an earlier talk presented to LUV.

Note: many links on this page point to files on your local file system. If you are not running Linux then they probably will not work. There are also links to man pages. These work in konqueror, and may or may not work with other browsers. If the link does not work just use the man command from a Linux command line.

Boot sequence summary

BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels

Page 4: Boot Process in Linux

BIOS

Load boot sector from one of:

Floppy CDROM Hard drive

The boot order can be changed from within the BIOS. BIOS setup can be entered by pressing a key during bootup. The exact key depends varies, but is often one of Del, F1, F2, or F10.

(DOS) Master Boot Record (MBR)DOS in the context includes MS-DOS, Win95, and Win98.

BIOS loads and execute the first 512 bytes off the disk (/dev/hda) Standard DOS MBR will:

o look for a primary partition (/dev/hda1-4) marked bootable o load and execute first 512 bytes of this partition

can be restored with fdisk /mbr from DOS

LILO

does not understand filesystems code and kernel image to be loaded is stored as raw disk offsets uses the BIOS routines to load

Loading sequence

load menu code, typically /boot/boot.b prompt for (or timeout to default) partition or kernel for "image=" (ie Linux) option load kernel image for "other=" (ie DOS) option load first 512 bytes of the partition

Reconfiguring LILO

One minute guide to installing a new kernel

Page 5: Boot Process in Linux

copy kernel image (bzImage) and modules to /boot and /lib/modules edit /etc/lilo.conf

o duplicate image= section, eg: o

image=/bzImage-2.4.14o

label=14o

read-onlyo man lilo.conf for details

run /sbin/lilo reboot to test

GRUB

Understands file systems config lives in /boot/grub/menu.lst or /boot/boot/menu.lst

Kernel

initialise devices (optionally loads initrd, see below) mounts root filesystem

o specified by lilo or loadin with root= parameter o kernel prints: VFS: Mounted root (ext2 filesystem) readonly.

runs /sbin/init which is process number 1 (PID=1) o init prints: INIT: version 2.76 booting o can be changed with boot= parameter to lilo, eg boot=/bin/sh can be useful to

rescue a system which is having trouble booting.

initrd

Allows setup to be performed before root FS is mounted

lilo or loadlin loads ram disk image kernel runs /linuxrc

o load modules o initialise devices

Page 6: Boot Process in Linux

o /linuxrc exits "real" root is mounted kernel runs /sbin/init

Details in /usr/src/linux/Documentation/initrd.txt (part of the kernel source).

/sbin/init

reads /etc/inittab (see man inittab which specifies the scripts below o Run boot scripts:

debian: run /etc/init.d/rcS which runs: /etc/rcS.d/S* scripts /etc/rc.boot/* (depreciated)

redhat: /etc/rc.d/rc.sysinit script which: loads modules, check root FS and mount RW, mount local FS, setup network, and mount remote FS

o switches to default runlevel eg 3. run scripts /etc/rc3.d/S* run programs specified in /etc/inittab

Run Levels

0 halt 1 single user 2-4 user defined 5 X11 only (0 or 1 text console) 6 Reboot Default is defined in /etc/inittab, eg:

o id:3:initdefault: The current runlevel can be changed by running /sbin/telinit # where # is the new

runlevel, eg typing telinit 6 will reboot.

Run Level programs

Scripts in /etc/rc*.d/* are symlinks to /etc/init.d o Scripts prefixed with S will be started when the runlevel is entered, eg

/etc/rc5.d/S99xdm

Page 7: Boot Process in Linux

o Scripts prefixed with K will be killed when the runlevel is entered, eg /etc/rc6.d/K20apache

o X11 login screen is typically started by one of S99xdm, S99kdm, or S99gdm. Run programs for specified run level /etc/inittab lines:

o 1:2345:respawn:/sbin/getty 9600 tty1 Always running in runlevels 2, 3, 4, or 5 Displays login on console (tty1)

o 2:234:respawn:/sbin/getty 9600 tty2 Always running in runlevels 2, 3, or 4 Displays login on console (tty2)

o l3:3:wait:/etc/init.d/rc 3 Run once when switching to runlevel 3. Uses scripts stored in /etc/rc3.d/

o ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now Run when control-alt-delete is pressed

Boot Summary

lilo o /etc/lilo.conf

debian runs o /etc/rcS.d/S* scripts o /etc/rc3.d/S* scripts

redhat runs o /etc/rc.d/rc.sysinit script o /etc/rc.d/rc3.d/S* scripts

-=====================================================================================

PC Boot and Linux Init Process:

1. BIOS: The Basic Input/Output System is the lowest level interface between the computer and peripherals. The BIOS performs integrity checks on memory and seeks instructions on the Master Boor Record (MBR) on the floppy drive or hard drive.

2. The MBR points to the boot loader (GRUB or LILO: Linux boot loader). 3. Boot loader (GRUB or LILO) will then ask for the OS label which will identify which kernel to run

and where it is located (hard drive and partition specified). The installation process requires to creation/identification of partitions and where to install the OS. GRUB/LILO are also configured during this process. The boot loader then loads the Linux operating system.

Page 8: Boot Process in Linux

o See the YoLinux tutorial on creating a boot disk for more information on GRUB and LILO and also to learn how to put the MBR and boot loader on a floppy for system recovery.

4. The first thing the kernel does is to execute init program. Init is the root/parent of all processes executing on Linux.

5. The first processes that init starts is a script /etc/rc.d/rc.sysinit 6. Based on the appropriate run-level, scripts are executed to start various processes to run the

system and make it functional.

The Linux Init Processes:

The init process is the last step in the boot procedure and identified by process id "1". Init is responsible for starting system processes as defined in the /etc/inittab file. Init typically will start multiple instances of "getty" which waits for console logins which spawn one's user shell process. Upon shutdown, init controls the sequence and processes for shutdown. The init process is never shut down. It is a user process and not a kernel system process although it does run as root.

System Processes:

Process ID Description

0 The Scheduler

1 The init process

2 kflushd

3 kupdate

4 kpiod

5 kswapd

6 mdrecoveryd

Init config file (Red Hat 7.3-9.0, Fedora Core 1-3): /etc/inittab

# Author: Miquel van Smoorenburg, # Modified for RHS Linux by Marc Ewing and Donnie Barnes

id:3:initdefault:

# System initialization.si::sysinit:/etc/rc.d/rc.sysinit

Page 9: Boot Process in Linux

l0:0:wait:/etc/rc.d/rc 0l1:1:wait:/etc/rc.d/rc 1l2:2:wait:/etc/rc.d/rc 2l3:3:wait:/etc/rc.d/rc 3l4:4:wait:/etc/rc.d/rc 4l5:5:wait:/etc/rc.d/rc 5l6:6:wait:/etc/rc.d/rc 6

# Things to run in every runlevel. This line is only in Red Hat 7.X Used to flush disk buffers.ud::once:/sbin/update

# Trap CTRL-ALT-DELETEca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, schedule a shutdown for 2 minutes from now.pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Canceled"

# Run gettys in standard runlevels1:2345:respawn:/sbin/mingetty tty12:2345:respawn:/sbin/mingetty tty23:2345:respawn:/sbin/mingetty tty34:2345:respawn:/sbin/mingetty tty45:2345:respawn:/sbin/mingetty tty56:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5x:5:respawn:/etc/X11/prefdm -nodaemon

Note that this config file directs the init process to run the shell script /etc/rc.d/rc.sysinit. This script should be used as is and NOT changed. Extend rc.local and NOT this script. This will (not in exact order):

Run /sbin/initlog Run devfs to generate/manage system devices Run network scripts: /etc/sysconfig/network Start graphical boot (If so configured): rhgb Start console terminals, load keymap, system fonts and print console greeting: mingetty,

setsysfonts The various virtual console sessions can be viewed with the key-stroke:

o RHEL6: ctrl-alt-F2 through F7. F1 is reserved for the GUI screen invoked in run level 5.

o Older systems: ctrl-alt-F1 through F6. F7 is reserved for the GUI screen invoked in run level 5.

Mount /proc and start device controllers. Done with boot configuration for root drive. (initrd) Unmount root drive. Re-mount root file system as read/write Direct kernel to load kernel parameters and modules: sysctl, depmod, modprobe

Page 10: Boot Process in Linux

Set up clock: /etc/sysconfig/clock Perform disk operations based on fsck configuration Check/mount/check/enable quotas non-root file systems: fsck, mount, quotacheck, quotaon Initialize logical volume management: vgscan, /etc/lvmtab Activate syslog, write to log files: dmesg Configure sound: sndconfig Activate PAM Activate swapping: swapon

Local system boot processes can be placed in file: /etc/rc.d/rc.local

The system will then boot to the runlevel set by the directive initdefault.

Also see:

init man page inittab man page

Linux init Run Levels:

The Linux boot process has six states of operation of which "0" is the shutdown state and "3" and above are fully operational with all essential processes running for user interaction. Upon system boot the LINUX system /sbin/init program starts other processes by performing the following:

Init will bring up the machine by starting processes as defined in the /etc/inittab file. The computer will be booted to the runlevel as defined by the initdefault directive in the

/etc/inittab file.

id:5:initdefault:

In this example a runlevel of "5" is chosen. Runlevel "5" will boot the system into GUI mode using XDM and X-Windows. Booting to runlevel "3" (often called console mode) is often used by servers which do not need a graphical user interface. If booted to init level "3" one can promote the run level with the command [root prompt]# init 5. See the more detailed explanation of run levels below.

The inittab file will allow you to capture key sequences (ctrl-alt-del), start dial in internet connections etc.

One of these process started by init is /sbin/rc. This script runs a series of scripts in the directories /etc/rc.d/rc0.d/, /etc/rc.d/rc1.d/, /etc/rc.d/rc2.d/, etc

Page 11: Boot Process in Linux

Scripts in these directories are executed for each boot state of operation until it becomes fully operational. Scripts beginning with S denote startup scripts while scripts beginning with K denote shutdown (kill) scripts. Numbers follow these letters to denote the order of execution. (lowest to highest)

Runlevel "3" will boot to text or console mode and "5" will boot to the graphical login mode ( "4" for slackware)

Runlevel Scripts Directory(Red Hat/Fedora Core)

State

0 /etc/rc.d/rc0.d/ shutdown/halt system

1 /etc/rc.d/rc1.d/ Single user mode

2 /etc/rc.d/rc2.d/ Multiuser with no network services exported

3 /etc/rc.d/rc3.d/ Default text/console only start. Full multiuser

4 /etc/rc.d/rc4.d/ Reserved for local use. Also X-windows (Slackware/BSD)

5 /etc/rc.d/rc5.d/ XDM X-windows GUI mode (Redhat/System V)

6 /etc/rc.d/rc6.d/ Reboot

s or S Single user/Maintenance mode (Slackware)

M Multiuser mode (Slackware)

One may switch init levels by issuing the init command with the appropriate runlevel. Use the command "init #" where # is one of s,S,0,1,3,5,6. The command telinit does the same.

The scripts for a given run level are run during boot and shutdown. The scripts are found in the directory /etc/rc.d/rc#.d/ where the symbol # represents the run level. i.e. the run level "3" will run all the scripts in the directory /etc/rc.d/rc3.d/ which start with the letter "S" during system boot. This starts the background processes required by the system. During shutdown all scripts in the directory which begin with the letter "K" will be executed. This system provides an orderly way to bring the system to different states for production and maintenance modes.

If you installed all demons (background processes), Linux will run them all. To avoid slowing down your machine, remove unneeded services from the start-up procedure. You can start/stop individual demons by running service init scripts located in the /etc/init.d/ directory:

Page 12: Boot Process in Linux

/etc/rc.d/init.d/ (Red Hat/Fedora) Also /etc/init.d/ which is linked to /etc/rc.d/init.d/

/etc/init.d/ (S.u.s.e.) /etc/init.d/ (Ubuntu / Debian)

and issuing the command and either the start, stop, status, restart or reload option i.e. to stop the web server:

/etc/init.d/httpd stop

Use the command ps -aux to view all process on your machine.

TIP: List state and run level of all services which can be started by init: chkconfig --list or service --status-all | grep running (Red Hat/Fedora Core based systems)

GUI tool: /usr/X11R6/bin/tksysv

Run Level Commands:

Shutdown: o init 0 o shutdown -h now

-a: Use file /etc/shutdown.allow -c: Cancel scheduled shutdown.

o halt -p -p: Turn power off after shutdown.

o poweroff Reboot:

o init 6 o shutdown -r now o reboot

Enter single user mode: o init 1

Init Script Activation:

Adding a script to the /etc/rc.d/rc#.d/ directory with either an S or K prefix, adds the script to the boot or shutdown process. The scripts are run in numerical order. S20abc is run before S30xyz. The extensibility to the boot and shutdown procedures of the operating system is one of the strengths of UNIX. The orderly sequential initiation of processes can be coordinated for dependent processes. The orderly shutdown of processes is often required of complex programs

Page 13: Boot Process in Linux

such as databases. This is how it is done. Individual processes may be monitored, shutdown and started at any time using these scripts. i.e. /etc/rc.d/rc2.d/httpd start. The modifiers start, stop or status may be used.

The start/stop/status scripts actually reside in the directory:

/etc/rc.d/init.d/ (Red Hat/Fedora) Also /etc/init.d/ which is linked to /etc/rc.d/init.d/

/etc/init.d/ (S.u.s.e. and Ubuntu / Debian)

and are linked to the appropriate directories. These links may be created or destroyed using the chkconfig command. i.e. chkconfig --del httpd will remove the web server from the startup and shutdown process. Inversely chkconfig --add httpd will add it to the startup/shutdown process by generating links from the script in /etc/rc.d/init.d/ to the appropriate /etc/rc.d/rc#.d/ directory. For more information see the LINUX manual page on init.

Basic services include:

System Service Description

anacronRun jobs which were scheduled for execution while computer was turned off. Catch up with system duties.

arpwatch Keeps track of IP address to MAC address pairings

atd Run scheduled batch jobs.

autofs automounts file systems on demand.

bluetooth, pand, hidd, dund

Bluetooth netwoork support.

crond Job sheduler for periodic tasks.

gpm Allows console terminal cut and paste. (Non X-window consoles)

https Apache web server.

iptables Firewall rules interface to kernel.

keytable Loads selected keyboard map as set in /etc/sysconfig/keyboard

kudzu New hardware probe/detection during system boot.

Page 14: Boot Process in Linux

lpd or cups Network printer services.

microcode_ctlUploads microcode to kernel and ultimately to the Intle Pentium processor. (Hardware specific.)

mysqld Database services

named DNS name services (Bind)

network Active network services during system boot. Required for network connectivity.

nfsNetwork file system. Unix file sharing services. Also uses services: nfslock, portmap, rpcgssd, rpcidmapd, rpcsvcgssd

nscdPassword and group lookup services for use with network authentication (NIS, LDAP,...).

ntpd Network Time Protocol time synchronization services.

random Random number generation tool used for encryption.

rawdevicesEnables raw IO. Useful for Oracle and software which utilizes this for high speed disk access.

smb SAMBA: MS/Windows PC file sharing services

syslog System log file facility.

ypbind NIS file sharing/authentication infrastructure service.

yppasswd NIS file sharing/authentication infrastructure service.

ypserv NIS file sharing/authentication infrastructure service.

xfs X-Windows font server.

Recommended basic services: anacron, ard, autofs, crond, gpm, iptables, keytable, kudzu, microcode_ctl (Intel32 hardware only), network, random. syslog Graphics Workstation - add: xfs File Server for PC clients - add: smb Print Server - add: lpd or cups (hplip - HP Linux Imaging and Printing) File server Linux/Unix clients - add: nfs, netfs, nfslock, portmap, ypbind, yppasswd, ypserv; NFSv4 add: rpcgssd, rpcidmapd, rpcsvcgssd Web Server - add: httpd, tux, xinetdi, sshd

Page 15: Boot Process in Linux

GUI configuration tools:GUI tools can help you configure the appropriate services to start and provide a description of each service available:

Fedora/RHEL: /usr/bin/system-config-services (Also /usr/sbin/serviceconf)

Red Hat 8.0/9.0: /usr/bin/redhat-config-services Ubuntu / Debian:

o bum (Boot Up Manager) (GUI image) o /usr/bin/services-admin (GUI image) o /usr/sbin/sysv-rc-conf (console program - see below)

Red Hat / Fedora Core GUI: system-config-services (and redhat-config-services)

Page 16: Boot Process in Linux

Red Hat/Fedora Core text console services selection tool: /usr/sbin/ntsysv

Page 17: Boot Process in Linux

Debian/Ubuntu: sysv-rc-conf (Install: aptget install sysv-rc-conf)

Page 18: Boot Process in Linux

Init Script:

A single copy of the script is located in the directory: /etc/rc.d/init.d/script-name (Red Hat/Fedora) or /etc/init.d/script-name (Ubuntu / Debian). Use the command chkconfig to generate soft links to the appropriate directories for the various run levels.

#!/bin/sh## Startup script for program## chkconfig: 345 85 15 - start or stop process definition within the boot process# description: Description of program# processname: process-name# pidfile: /var/run/process-name.pid

# Source function library. This creates the operating environment for the process to be started. /etc/rc.d/init.d/functions

Page 19: Boot Process in Linux

case "$1" in start) echo -n "Starting process-name: " daemon process-name - Starts only one process of a given name. echo touch /var/lock/subsys/process-name ;; stop) echo -n "Shutting down process-name: " killproc process-name echo rm -f /var/lock/subsys/process-name rm -f /var/run/process-name.pid - Only if process generates this file ;; status) status process-name ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading process-name: " killproc process-name -HUP echo ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1esac

exit 0

The bash script functions daemon, killproc and status can all be found in the script /etc/rc.d/init.d/functions. (Red Hat/Fedora distributions)

The script must be executable to work. (chmod +x script-name).

The script may be used to start and stop processes. i.e.:

/etc/rc.d/init.d/httpd restart (Ubuntu / Debian / S.u.s.e.: /etc/init.d/apache2 restart)

/etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start

OR use the Red Hat/Fedora core based service command:

Page 20: Boot Process in Linux

service httpd restart service httpd stop service httpd start

Note that two lines in the script enable the chkconfig command to control the script for the boot and shutdown process.

# chkconfig: 345 85 15 # description: Description of program

When added to the boot process using the "chkconfig --add script-name" command the start order/priority will be set to 80 while the stop/shutdown order will be set to 15. The process will be added to runlevels 3, 4 and 5. This is enabled by generating links from the location of the script (/etc/rc.d/init.d/) to the directory for the appropriate run level: /etc/rc.d/rc#.d/. The file name in the run level directory will reflect if it is used for boot (starts with an "S") or shutdown (starts with a "K")

chkconfig:

The (Red Hat/Fedora/IRIX) chkconfig command generates and breaks links between the directory /etc/rc.d/init.d/ and the appropriate run level directory: /etc/rc.d/rc[0-6].d/ to control boot process initiation and process shutdown.

chkconfig [--level ] on | off | reset > chkconfig --list chkconfig --list chkconfig --add

chkconfig --del chkconfig --level 0123456 off

Examples:

chkconfig --level 345 httpd on - forces apache to be invoked for run levels 3, 4 and 5. chkconfig --add httpd - Start the web server daemon upon system boot. chkconfig --del sendmail - Do not start the sendmail daemon upon system boot. chkconfig --list - List all services and init levels. chkconfig --list | grep on - List all services to be started upon system boot.

Using chkconfig to administer xinetd processes.

chkconfig wu-ftpd on - Turn on FTP service managed by xinetd. chkconfig ipop3 off - Turn off POP3 service managed by xinetd.

Page 21: Boot Process in Linux

This will reconfigure the appropriate xinetd file (in directory /etc/xinetd.d/) and restart the xinetdprocess.