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.

1. Click System, select Administration, select Server Settings and click Services. This will launch the Service Configuration window.

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.
You 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 service - /sbin/service [name] stop
stops the service - /sbin/service [name] status
displays the service status - /sbin/chkconfig ––list
displays all the available services - /sbin/chkconfig ––level 345 [name] on
automatically runs the service on the next startup - /sbin/chkconfig ––level 345 [name] off
removes the service from the startup list
***
Posted on 4/23/2007 and last updated on 8/8/2008
Filed under CentOS 5 , Red Hat Enterprise Linux 5 , System Administration
Share This

April 2nd, 2008 at 12:22 pm
Nice to know but please give command line alternative too…
April 5th, 2008 at 2:29 pm
Done.
May 5th, 2008 at 12:24 pm
This service command doesn’t seem to be there in centos5. Please give me a command to start dovecot deamon in centos5 via ssh
May 5th, 2008 at 12:47 pm
If that’s the case, it probably means Dovecot is not installed. You can definitely use the commands above via ssh.
August 1st, 2008 at 6:35 pm
The service command is there in Centos 5, but you have to look in /sbin. It’s not part of the default PATH.
August 8th, 2008 at 2:32 pm
You’re right, thanks. I’ve updated the text so the commands should work even if /sbin is not in the PATH environment variable.
August 28th, 2008 at 7:29 am
is there a difference restarting service from the /sbin/service [servicename] and /etc/init.d/[servicename] ?
August 28th, 2008 at 10:30 pm
/sbin/service [servicename] is actually an RHEL wrapper command for /etc/init.d/[servicename]
October 29th, 2008 at 4:19 pm
sorry but also the httpd didnt start