Everything which is executed or is running on a Linux machine is linked to a service. In many cases, we come across situations when we have to restart those services. Those situations could be like service is using too much RAM memory or consuming a lot of CPU or the service is malfunctioning or could be any other situation for testing purposes. So, in order to do that we have to follow the procedure which is given below.
Flowchart of the process

The very first step is to open the terminal and look for the service to restart. Then just fire a command to restart the service and the service will stop and start again.
To do it practically
1. Open the terminal:

All the Linux distributions have an application menu, so just look for the terminal there and open the same. After finding the terminal, just click on the app icon to open it. In many Linux, the terminal will be at the top or bottom of the screen in the application dock.
2. Displaying the running service:

So to display the current running service just type the following command.
ls /etc/init.d
So typing this will give you all the services that are running currently.
3. Services you want to restart:

So just select the service you want to restart, you will generally find the service you want to restart on the left side of the screen(it depends on your Linux distribution). For instance let it be “apache2”
4. Restarting your service:
So Basically at this stage, you have selected the service you want to restart.So type the following command to restart the service
sudo systemctl restart apache2
5. Entering Authentication Details:

Type in the password of your linux user account then as soon as you press enter the service would be restarted.
Alternative Method
So if the above method didn’t work then just type the following command
sudo systemctl stop service
Then press Enter, this will stop your service. Then enter the following command to start the service again.
sudo systemctl start service
This will start your service again.
Recommended Posts:
- Service Boot Persistence in Linux
- What is init.d in Linux Service Management?
- Linux - Network Information Service
- Linux Virtualization : Linux Containers (lxc)
- Difference Between Arch Linux and Kali Linux
- Denial of Service DDoS attack
- How to make sure that Apache service keeps running in Ubuntu
- What is DDoS(Distributed Denial of Service)?
- What is DSU(Digital Service Unit)?
- What is MMS(Multimedia Messaging Service)?
- How to find time taken by a command/program on Linux Shell?
- Terminal Mail and Linux Security Mail
- Linux Virtualization - Chroot Jail
- Linux Kernel Module Programming: Hello World Program
- Formatted text in Linux Terminal using Python
- Some useful Linux Hacks
- Some time-saving tips for Linux Users
- Daily life Linux Commands
- Basic Linux Commands for day to day life
- Initializing and Cache Mechanism in Linux Kernel
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

