11.01.2015 Views

Red Hat Enterprise Linux Installation Guide 5.2 - linux.meuhobby.com

Red Hat Enterprise Linux Installation Guide 5.2 - linux.meuhobby.com

Red Hat Enterprise Linux Installation Guide 5.2 - linux.meuhobby.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 30. Boot Process, Init, and Shutdown<br />

S90xfs -> ../init.d/xfs<br />

S95atd -> ../init.d/atd<br />

S96readahead -> ../init.d/readahead<br />

S97messagebus -> ../init.d/messagebus<br />

S97rhnsd -> ../init.d/rhnsd<br />

S99local -> ../rc.local<br />

As illustrated in this listing, none of the scripts that actually start and stop the services are<br />

located in the /etc/rc.d/rc5.d/ directory. Rather, all of the files in /etc/rc.d/rc5.d/ are<br />

symbolic links pointing to scripts located in the /etc/rc.d/init.d/ directory. Symbolic links<br />

are used in each of the rc directories so that the runlevels can be reconfigured by creating,<br />

modifying, and deleting the symbolic links without affecting the actual scripts they reference.<br />

The name of each symbolic link begins with either a K or an S. The K links are processes that<br />

are killed on that runlevel, while those beginning with an S are started.<br />

The init <strong>com</strong>mand first stops all of the K symbolic links in the directory by issuing the<br />

/etc/rc.d/init.d/ stop <strong>com</strong>mand, where is the process to be killed. It<br />

then starts all of the S symbolic links by issuing /etc/rc.d/init.d/ start.<br />

Tip<br />

After the system is finished booting, it is possible to log in as root and execute<br />

these same scripts to start and stop services. For instance, the <strong>com</strong>mand<br />

/etc/rc.d/init.d/httpd stop stops the Apache HTTP Server.<br />

Each of the symbolic links are numbered to dictate start order. The order in which the services<br />

are started or stopped can be altered by changing this number. The lower the number, the<br />

earlier it is started. Symbolic links with the same number are started alphabetically.<br />

Note<br />

One of the last things the init program executes is the /etc/rc.d/rc.local<br />

file. This file is useful for system customization. Refer to Section 3, “Running<br />

Additional Programs at Boot Time” for more information about using the<br />

rc.local file.<br />

After the init <strong>com</strong>mand has progressed through the appropriate rc directory for the runlevel,<br />

the /etc/inittab script forks an /sbin/mingetty process for each virtual console (login<br />

prompt) allocated to the runlevel. Runlevels 2 through 5 have all six virtual consoles, while<br />

runlevel 1 (single user mode) has one, and runlevels 0 and 6 have none. The /sbin/mingetty<br />

process opens <strong>com</strong>munication pathways to tty devices 2 , sets their modes, prints the login<br />

342

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!