What does systemctl daemon-reload do?
This article has last been updated at .
What does 'systemctl daemon-reload' do?
When running 'systemctl daemon-reload', the systemd manager configuration is reloaded. It does this by running the generators that are helper scripts to create non-native systemd scripts. The dependency tree that links units in the right order is recreated and unit files containing their configuration are reloaded.
Systemd stores the configuration for units, like services, in individual unit files. When changes are made to these units, a reload might be needed. This is where systemctl daemon-reload
comes into play. But what exactly does the daemon-reload subcommand really do? In short: rerun generators, reload units files, recreate the dependency tree. Let’s have a look at the more detailed answer.
Running generators
Generators are helper scripts to convert non-native scripts to unit files that are usable by systemd. These generators are used during the boot, but also when the daemon configuration is reloaded. In multiple phases all generators are started in parallel, with the goal to minimize the time tasks are waiting for each other to finish.
Reloading the units
The configuration of the units needs to be checked and reloaded. Any change that has a different condition than before, might trigger a reload or restart of a unit.
Dependency tree update
Systemd is focused on optimizing how units interact with each other, like which service depends on another service or unit. This set of dependencies is updated, so services are started in the right order.