12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

120CHAPTER 4Understanding <strong>Linux</strong> ConceptsThe initialization scripts can also be used to start, stop, and restart services after thesystem has booted. These actions are performed with the service command as the rootuser. Each script has its own list of actions. Common actions defined include start, stop,conrestart (which stops and starts the service only if it is already running), and status.To perform an action, use the following syntax:service For example, the following starts the OpenSSH service:service sshd startAs each service with an initialization script is discussed in this book, a list of actions thatcan be performed with the script is given.RunlevelsHow does the system know which initialization scripts to run so that only the desiredservices are started at boot time? <strong>Linux</strong> uses the concept of runlevels to define which servicesto start at boot time. There are 7 runlevels, with each having its own general purpose:. 0: Halt the system. 1: Single-user mode (see Chapter 10, “Techniques for Backup and Recovery” fordetails). 2: Not used. 3: Multi-user mode with text login. 4: Not used. 5: Multi-user mode with graphical login. 6: RebootEach runlevel has its own directory named rcX.d in /etc/rc.d/, where X is the runlevelnumber. Each of these directories contains symbolic links to the actual initialization scripts in/etc/rc.d/init.d/. Each symbolic link start with the letter S or K followed by a number. TheS stands for start, and the K stands for kill, which means to stop a process. When a runlevel isinitialized, all the services starting with K are stopped first, and then all the services startingwith S are started. The number following the letter determines the order in which the stopand start actions are performed. The lower the number, the sooner it is executed.Changing the Default RunlevelBy default, <strong>Red</strong> <strong>Hat</strong> <strong>Enterprise</strong> <strong>Linux</strong> boots into runlevel 5 with a graphical login screenand a graphical desktop once the user successfully authenticates. Runlevel 3 is essentiallythe same except the text login is used. Runlevels 2 and 4 are not reserved for a specificmode, but they can be defined for specific purposes if needed.

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

Saved successfully!

Ooh no, something went wrong!