Starting and stopping services is easy in Red Hat Enterprise Linux 5 and its derivative CentOS 5. Both includes the Service Configuration tool which simplifies service administration.

Service Configuration1. Click System, select Administration, select Server Settings and click Services. This will launch the Service Configuration window.
Service Configuration
2. In the Service Configuration window, check the service you wish to start on the next system startup, in this case the service postfix. To start the service immediately, press Start.
 
Unchecked services will not be started on the next system startup. To immediately stop a service, select the service and press Stop.
 
To restart a service, select the service and press Restart.
Service Configuration3. Press Save to save your changes.
Service Configuration4. You can also do the same for On-Demand Services.
NoteYou can also do this from the command line, below are the equivalent commands. You need to have root level access to use the commands below.
  • /sbin/service [name] start
    starts the background service
  • /sbin/service [name] stop
    stops the background service
  • /sbin/service [name] restart
    restarts the background service
  • /sbin/service [name] status
    displays the background service status
  • /sbin/chkconfig ––list
    displays all the available services
  • /sbin/chkconfig ––level 345 [name] on
    automatically runs the background service on the next startup
  • /sbin/chkconfig ––level 345 [name] off
    removes the background service from the startup list
  • /sbin/chkconfig [name] on
    enables the on-demand service
  • /sbin/chkconfig [name] off
    disables the on-demand service

Visit the forum to ask for help or to give a comment.

***
Posted on 4/23/2007 and last updated on 11/7/2009
Filed under CentOS 5 , Red Hat Enterprise Linux 5 , System Administration