Raspberry Pi

How to Stop, Start and Restart Services on Raspberry Pi OS

The Raspberry Pi is a Linux-based platform where many services perform different functions in the background. Most of these services are installed and running on the system, while others are installed manually. These services are consuming system resources; thus, some are not required to run regularly. However, some services like WiFi, SSH, and others are required to remote access the device. Thus, they must be running at any cost, even if they are stopped or have any issues.

If you are unsure how to stop, start or restart services on the Raspberry Pi system, follow this guide.

Stop, Start and Restart Services on Raspberry Pi OS

The “systemctl” and “service” are widely used system commands that allow users to stop, start or restart services on the system, including the Raspberry Pi.

However, before moving toward the commands, let’s find out the services running on our Raspberry Pi system through the following command:

$ service --status-all

Now, you can stop, start or restart the service you want to the Raspberry Pi system through below instructions.

Stop a Service on Raspberry Pi

If you want to stop a service running in the background to reduce the Raspberry Pi resource consumption, you should immediately use the following command to stop the service on the system.

$ sudo systemctl stop <service_name>

Don’t forget to replace the “service_name”.

Or you can use the following command that performs a similar function:

$ sudo service <service_name> stop

To confirm the service is stopped on the Raspberry Pi system, you can use the following command:

$ sudo systemctl status <service_name>

$ sudo service <service_name> status

Start a Service on Raspberry Pi

You can start the service anytime using the following command:

$ sudo systemctl start <service_name>

Or

$ sudo service <service_name> start

Restart a Service on Raspberry Pi

If there is an error running a service on the system, hit the following command to reload or restart the service.

$ sudo systemctl restart <service_name>

Or:

$ sudo service <service_name> restart

Enable Service on Raspberry Pi

To enable the service, simply issue the below-given command:

$ sudo systemctl enable <service>

In this way, you can stop, start or restart any service on the Raspberry Pi system.

Conclusion

To stop, start and restart a service on Raspberry Pi, you can use the systemctl or service utilities. Both these utilities do the job a lot easier on the terminal. You need to find the service name using the “–status-all” command and execute the above commands to quickly stop, start, or restart the service on the Raspberry Pi system.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.