1. Home
  2. Computing & Technology
  3. Linux

GNU/Linux Command-Line Tools Summary

From


   GNU/Linux Command-Line Tools Summary
   Prev    Chapter 9. Controlling the system    Next

9.4. Controlling services

  • Concept Definitions
  •    

    UNIX systems use scripts to control "daemons" which provide "services" (for example your sound output) to run a UNIX system. UNIX systems consist of a variety of services (daemons).

    A "daemon" is a system process which runs in the background (zero interaction) performing a particular task.

    Daemons normally have a "d" on the end of their name and either listen for certain events or perform a system task, for example sshd listens for secure shell requests to the particular machine and handles them when they occur.

    Daemons usually perform critical system tasks such as control swap-space, memory management and various other tasks.


  • service
  •    

    service is a shell script available on Mandrake/Mandriva and Redhat systems which allows you to perform various tasks on services.

    • Use the -s option to print the status of all services available

    • Use the -f option followed by a service name to restart that particular service.

    • Use the -R option to restart all services (note that this will kill any current services running, including the X windows system).

    For example to restart the daemon sshd you would type:


       

    service -f sshd


  • Using the script directly
  •    

    You may also execute the shell script directly from /etc/init.d . Simply go to that directory then type ./script_name .

    Executing the script should return the options it can take, by default they will be:

    • restart --- this will make the service stop and then start again.

    • start --- this option will start a service (assuming its not running).

    • stop --- this option will stop a service (assuming its running).

    • status --- this option will tell you about the service



   Prev    Home    Next
   Controlling Processes    Up    Managing users


* License

* GNU/Linux Command-Line Tools Summary Index

Explore Linux
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux Documentation
  5. Linux Tools Summary
  6. GNU/Linux Command-Line Tools Summary - Controlling services

©2009 About.com, a part of The New York Times Company.

All rights reserved.