What is the Difference Between daemon-reload and reload?

Linux offers a wide range of command line utilities that can perform all the basics and advanced tasks on the system like install, remove, update, reboot, and much more. The most commonly used commands while working with system services are “daemon-reload” and the “reload”. Both these utilities are designed for reloading the system services but there are also some key differences between them.

This post highlights the key differences between daemon-reload and reload.

How Does daemon-reload Work in Linux?

The “daemon-reload” reloads changes or modifies the systemd unit files. These unit files are placed in the “/etc/systemd/system” directory and require reloading if any changes are made to them.

Execute the “daemon-reload” command with the root user privileges, i.e., “sudo” and the “systemctl” command that manages the systemd manager:

$ sudo systemctl daemon-reload

The unit files have been reloaded without reloading the specific service configuration. 

How Does reload Work in Linux?

The “reload” is the command line tool that reloads the particular service without entirely shutting down or starting the service again. The systemd sends a SIGHUP signal to the service for reloading its configuration files. It also requires the service name to receive the SIGHUP signal.

Specify the service name, i.e., apache2 with the “sudo” and “systemctl” commands to reload its configuration files:

$ sudo systemctl reload apache2

The configuration files of the “apache2” service have been reloaded successfully.

Difference Between daemon-reload and reload

The main difference between “daemon-reload” and the reload command is highlighted in this section:

  • The “daemon-reload” changes in the service systemd unit files whereas the “reload” reloads the change in specific service configuration files.
  • The “daemon-reload” does not require any additional parameter as the “reload” service name. It checks all of the system service files for modification/changes in the files and reloads them.
  • Both these commands perform their job without stopping the service. However, in the case of “reload”, if the installed service is stopped then, it can never be reloaded.

Conclusion

In Linux, the “daemon-reload” reloads the entire systemd unit files while the “reload” only reloads the specific service configuration files. The demon-reload is specially designed for systemd and the “reload” is for specific existing services. These utilities do not affect the services running state.

This post has illustrated the difference between daemon-reload and reload commands.