Systemctl daemon-reload.


The unit file determines how the systemd starts and runs.


The unit can be of different types, such as Target, Socket, Device, Mount, Automount, Swap, Slice, or Timer (a unit of this type activates/deactivates specified service based on a timer or when the set time is elapsed.)

And of course, the most common of them is known as "service" (a unit of this type starts, stops, restarts, or reloads a service daemon such as Apache webserver.)

The unit files are located under the /etc/systemd/system directory but can be managed from any location on your system.

Systemctl (Linux command-line utility) is used to control and manage systemd as well as services on systemd-enabled systems.

Systemctl is a control interface for Systemd init service, allowing you to communicate with systemd and perform operations. It contains libraries, daemons, and utilities you can use to manage services in the Linux system.

Remember, that whenever you make changes to a systemd unit file, you will need to reload the systemd to pick up those changes.


Applying changes to Systemd Unit Files


Run the below command in order to apply those changes to the systemd:

$ sudo systemctl daemon-reload


This command does not reload or restart the service; it makes systemd aware of the new configuration(s). It reloads the unit configuration files, not the service-specific configurations.

Next, the service needs to be restarted (or reloaded):

Tips: You can use the reload-or-restart command if you are unsure about whether your application needs to be restarted or just reloaded.

$ sudo systemctl reload-or-restart whatever-service-name

or

$ sudo systemctl restart whatever-service-name


What this (reload-or-restart) does is reload one or more units if they support it. If not, stop and then start them instead. If the units are not running yet, they will be started.

Thank you for stopping by and have yourself a good one!