M BUZZ CRAZE NEWS
// news

What is the difference betweem daemon-reload and reload?

By Jessica Wood

daemon-reload - Load the unit configuration file of the running designated unit(s) to make unit file configuration changes without stopping the service. Note that this is different from the reload command

reload - Load the service configuration file of the running designated unit(s) to make service configuration changes without stopping the service. Note that this is different from the daemon-reload command.

What is unit and service here ? For example apache2.service is a unit with service type . Then what is service in the above description ??

1 Answer

daemon-reload will reload systemd files. If you change a service file in /etc/systemd/system/, daemon-reload will reload these files.

For instance, you realize that you need a 5 seconds timeout between restarts in a service. You add that timeout in a service file and make a daemon-reload. That will cause a timeout on next service restart. Service configuration will not be affected by that change.

reload will reload a specific service. That means that the systemd will send a SIGHUP signal to a service, and that signal will tell the service to reload its configuration files, which has nothing to do with systemd config files.

For instance, apache has a file httpd.conf. With reload, systemd will send a SIGHUP to a running apache to tell it to reload the configuration file. However, that will not change anything, how the service is treated by systemd.

With reload you have to provide additional parameter(s), telling which services will receive SIGHUP signal. With daemon-reload you do not provide any additional parameters, as systemd will check all its service files for changes and reload them.

It is not written in manual, but I guess a service has to support reloading in order to make reload successful. Otherwise, you have to restart it to force it to reload configuration.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy