Starting and Stopping Services Manually

 < Day Day Up > 

If you change a configuration file for a system service, it is usually necessary to stop and restart the service to make it read the new configuration. If you are reconfiguring the X server, it is often convenient to change from runlevel 5 to runlevel 3 to make testing easier and then switch back to runlevel 5 to re-enable the graphical login. If a service is improperly configured, it is easier to stop and restart it until you have it configured correctly than it is to reboot the entire machine.

There are several ways to manually start or stop services or to change runlevels while using Fedora Core Linux. The traditional way to manage a service (as root) is to call the service's /etc/rc.d/init.d name on the command line with an appropriate keyword, such as start, status, or stop. For example, to start the automated nightly update of the YUM RPM package database, call the /etc/rc.d/init.d/yum script like this:

 # /etc/rc.d/init.d/yum start Enabling nightly yum update:                                    [  OK  ] 

The script will execute the proper program(s) and report the status of it. Stopping services is equally easy, and in fact, you can also check the status of some services by using the status keyword like this:

 # /etc/rc.d/init.d/yum status Nightly yum update is enabled. 

In this example, the yum script reports that the daemon is running. This information might be useful for other system management tasks.

A much easier way to manually start or stop a service is to use a script named service. Using service, you do not have to know the full pathname to the system service; you only need know the name of the system service you want to manipulate. Using this approach, the previous Yum example looks like this:

 # service yum start Nightly yum update is enabled:                                    [  OK  ] 

Of course, the GUI tools mentioned before also have the functionality to start and stop specific services in your current runlevel. The tool you choose is a matter of personal preference; a good system administrator will be aware of them all.

Relevant Fedora Core Linux Commands

Here are some of the commands you learned so far:

chkconfig Fedora Core's text-only command-line runlevel configuration utility.

ntsysv Fedora Core's text-based system services configuration tool for the command line.

setup Actually a BASH script, it is a menu to all the individual ncurses-based configuration tools, including ntsysv.

system-config-services Fedora Core's GUI runlevel configuration tool, named Configure Services.

telinit Changes the current runlevel.


     < Day Day Up > 


    Red Hat Fedora 4 Unleashed
    Red Hat Fedora 4 Unleashed
    ISBN: 0672327929
    EAN: 2147483647
    Year: 2006
    Pages: 361

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net