Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between 'service apache2 reload' and 'sudo systemctl restart apache2'?

What is the difference between service apache2 reload and sudo systemctl restart apache2?

I understand that one uses sudo and others don't. Also, I can understand the difference between reloading and restart. But what is the major difference between these two commands?

like image 725
sofs1 Avatar asked Jan 21 '26 10:01

sofs1


2 Answers

Restart = stop + start
Reload = remain running + re-read configuration files

like image 160
Zeeshan Ayub Avatar answered Jan 24 '26 02:01

Zeeshan Ayub


We could define it like this:

Restart--> STOP the service and then it will START the service.

Now comes Reload option.

Reload--> Read .service file for which you have executed the command and if any changes happened it will start using those changes now, so each time a change happens in any service file a reload is needed. You could even see this message coming, lets say you have changed a service and you forgot to reload it so whenever you run any systemctl command towards that service it will throw an error to reload it.

like image 32
RavinderSingh13 Avatar answered Jan 24 '26 02:01

RavinderSingh13



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!