Linux Commands

How to Reload Change to Systemd Unit Files?

A unit in systemd is described as any resource that the system is aware of and can be controlled. This is the basic entity for which the systemd knows how to handle with. These resources are stated in the configuration files, which are also known as unit files. Systemd uses these unit files to configure and control different resources like processes and filesystem. The unit file determines how the systemd starts and runs. The unit can of different types, and the most common of them is known as “service”. Unit files are placed under the /etc/systemd/system directory. Systemctl is used to manage services on systemd enabled systems.

In systemd unit files, you can make configuration changes in different ways. Whatever method you use, remember that whenever you make any changes to the systemd unit file, you will need to reload the systemd to pick up those changes.

Reloading Change to Systemd Unit Files

In order to reload the change to the systemd unit file, the command is as follows:

$ sudo systemctl daemon-reload

This command does not reload or restart the service; it only notifies the system about the changes in the configurations. In other words, you can say it will reload the unit configuration files, not the service-specific configurations.

After that, restart (or reload) the service as required:

$ sudo systemctl restart your-service-name

This is how you can reload change to systemd unit files using a single command. You can use this command for any Linux distribution that uses systemd.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.