Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between, service reload and service restart? [closed]

Tags:

linux

What the difference between services [name] reload and service [name] restart? actually, they same.. well, what recommand to use?

like image 781
Wiredguy Avatar asked Sep 10 '11 19:09

Wiredguy


People also ask

What is service restart?

The Restart-Service cmdlet sends a stop message and then a start message to the Windows Service Controller for a specified service. If a service was already stopped, it is started without notifying you of an error.

What is the difference between restart and start?

There is no difference, it's all about the context of the sentence. There is almost no difference but "start over" is more for actions performed by people. It also means you're starting from the very beginning again. It's similar to "redo." "I forgot to put eggs in the cake.

What does Systemctl restart do?

systemctl start: Used to start a service (not reboot persistent) systemctl stop: Used to stop a service (not reboot persistent) systemctl restart: Used to stop and then start a service.

What is difference between Systemctl and service?

The service command is used for running these init scripts from the terminal. SystemD, on the other hand, is a recent initialization system that aims to replace SysVInit. In fact, most Linux distributions such as Debian and Red Hat are already using SystemD as their init system out of the box.


4 Answers

Some services which support the reload command can reload their configuration without fully shutting down and starting up again. Postfix does this, as does Apache. It is very useful if you need to make configuration changes to a live server without incurring even a few seconds of downtime.

like image 149
Michael Berkowski Avatar answered Oct 27 '22 10:10

Michael Berkowski


Reload will tell the service to reload its configuration files, but keep the same process running. Restart tells it to shut down entirely, then restart.

like image 23
Kevin Lacquement Avatar answered Oct 27 '22 09:10

Kevin Lacquement


Generally speaking, restart will terminate the service in question and restart it; reload will only reload the configuration file.

Since reload only reloads the config, it will cause less disruption to existing activities and currently open connections; users might not even notice that it was run. However, depending on what server we're talking about, some options may not be changeable using reload; and if the server is using too much memory, etc, it may be necessary to use restart to force it to start from a clean slate.

Further, note that not all services support reload; all services support restart.

like image 45
bdonlan Avatar answered Oct 27 '22 11:10

bdonlan


restart shuts the service down and then starts it up again, whereas reload instructs the daemon to reload its configuration. You use whichever is appropriate for your situation.

like image 39
Ignacio Vazquez-Abrams Avatar answered Oct 27 '22 11:10

Ignacio Vazquez-Abrams