Restarting vs Reloading A Linux Service

If you are making changes to configuration files such as Apache or Postfix for example, you will need to either restart or reload the service for the changes to take effect. So what is the difference between a Linux service reload and a Linux service restart?

Reloading A Service

When you reload a service the processes for that service keep running and the new configuration is applied. This is great if you don’t want to experience any downtime but still need to make configuration changes. An example of this would be modifying the Apache configuration file on a live web server, you would reload the service if possible instead of restarting to minimize chances of downtime. Here is an example of how to reload a Linux service.

sudo systemctl reload <service name>

For older distributions, you would use init instead, here is an example of how to reload a service on older distributions.

sudo /etc/init.d/<service name> reload

Restarting A Service

Restarting a service is what you would do if said service cannot be reloaded or if the service is unresponsive. For example, if a service were to hang or crash, you would restart the service instead of reloading. Restarting a service will cause the service to be unavailable for a few seconds while it restarts. Here is an example of how to restart a Linux service.

sudo systemctl restart <service name>

For older distributions, you can use the following method to restart a service.

sudo /etc/init.d/<service name> restart

I hope this guide has helped you understand the difference between reloading and restarting a Linux service. For more information on working with Linux services, please see the other guide I wrote here.

Please don’t forget to like, comment, or share this post using the social media buttons below. Thank you!

 

Leave a Reply

Protected with IP Blacklist CloudIP Blacklist Cloud