Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  50] [ 0]  / answers: 1 / hits: 121937  / 3 Years ago, sat, june 5, 2021, 9:12:17

I'm trying to understand the difference between service restart [someservice] and service reload [someservice]. I understand that restart restarts the service whereas reload reloads the configuration. But I don't understand the practical implications of this well enough to determine which I should use in a given context.


An example: most guides I've read for setting up PostgreSQL say that, once I've edited postgresql.conf and pg_hba.conf to allow remote connections, I should run:


sudo service postgresql restart

However, if I were to guess which to use based on the description above, I would choose reload.


In case it matters, I'm on Ubuntu 11.10, though I'm hoping for an as generally applicable explanation as possible.


More From » server

 Answers
4

What you said is correct, reload tells the service to reload its configuration files. That means it should be sufficient to reload the configuration; however there may be certain services that "don't follow the rule" or that won't reload config files. Due to this you're probably safer with restart. I personally do not use postgresql, so I don't know.


[#40314] Monday, June 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rowbris

Total Points: 419
Total Questions: 122
Total Answers: 101

Location: Norway
Member since Mon, May 23, 2022
2 Years ago
;