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...

Create successful ePaper yourself

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

Runlevels 121The default runlevel is configured on the following line from the /etc/inittab file:id:5:initdefault:To change the default runlevel, modify this line. The next time the system is booted, it isbooted into the new default runlevel. To change to a different runlevel without rebooting thesystem, execute the following command as root, where is a number from 0 to 6:init Configuring the RunlevelsTo configuring which services are started for a runlevel, use one of three programs:chkconfig (command line only), ntsysv (simple text-based application that doesn’trequire a graphical desktop), or the Service Configuration Tool (graphical application).The chkconfig command can be used to configure runlevels and list the current runlevelconfiguration. It must be run as root if modifying a runlevel. Otherwise commands suchas listing whether a service is started at boot time can be run as a non-root user.4To list the status of all services, execute the chkconfig --list command. A line is outputfor each service such as the following for the Apache HTTP Server:httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:offTo list the status for just one service, provide the name of the service:chkconfig --list To modify whether the service is turned on or off for the runlevel, specify the servicename and then on, off, or reset. Set it to on to have the service started at boot time. Setit to off to have the service stopped at boot time. Setting it to reset resets the values ofall runlevels to the defaults from the initialization script. The syntax is as follows:chkconfig [on|off|reset]If no runlevels are given, runlevels 2, 3, 4, and 5 are modified. To only modify one ormore runlevels, use the following syntax where levels is a list of runlevel numbers notseparated by spaces or commas such as 35 for runlevels 3 and 5:chkconfig —level [on|off|reset]To run the Service Configuration Tool, select <strong>Administration</strong>, Server Settings, Servicesfrom the System menu on the top panel of the desktop. Or, execute the system-configservicescommand. If running as a non-root user, you must enter the root passwordbefore continuing. The application allows you to configure which services are started forrunlevels 3, 4, and 5. On the Background Services tab, it also allows you to start andstop services. The On Demand Services tab provides an interface for enabling ordisabling any xinetd services on the system.

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

Saved successfully!

Ooh no, something went wrong!