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


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
December 1st, 2008 at 4:10 pm
Hi Guys,
Need some help pls (new to linux).
I’ve followed all the instruction on this site and I am noticing an error when starting the MailScanner service:
[root@jhb ~]# /sbin/service MailScanner start
Starting MailScanner daemons:
incoming postfix: [ OK ]
outgoing postfix: [ OK ]
MailScanner: chown: missing operand after `postfix’
Try `chown –help’ for more information.
[ OK ]
I’m not sure if the above error is related to my problem, but I am battling to get procmail to filter spam from Spamassasin and place the spam into a specific mailbox for us to review if need be. The current config works fine as mail is passing through the server currently and spam email are being flagged as {spam} when the user receives it. The problem comes in when I enable the;
mailbox_command = /usr/bin/procmail -a “$EXTENSION”
line within the Postfix main.cf file in order to get Procmail active within Postfix. The symptom is that all the mail gets held up within the Postfix mail queue. Nothing is reported in the maillogs…
Please assist if possible or let me know what more info you may require.
Thanks for the great site! Makes it easier for us MS guys to start seeing the brighter side of life out there!