The following examples show how to start or stop or restart a service in different flavours of Linux. In all these examples, the service name “httpd” is used. You can replace it with name of the service you want to start or stop or restart.

Starting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd start

or

[root@techpulp ~]# /etc/init.d/httpd start

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd start

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd start

Stopping a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd stop

or

[root@techpulp ~]# /etc/init.d/httpd stop

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd stop

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd stop

Restarting a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd restart

or

[root@techpulp ~]# /etc/init.d/httpd restart

In Debian Linux:

[root@techpulp ~]# /etc/init.d/httpd restart

In Ubuntu Linux:

[root@techpulp ~]# sudo /etc/init.d/httpd restart

Checking the status of a service

In RHEL or Fedora:

[root@techpulp ~]# service httpd status

or

[root@techpulp ~]# /etc/init.d/httpd status