Why can’t systemd reload unit files automatically? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Why can’t systemd reload unit files automatically? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

Sometimes I forget to run systemctl daemon-reload after editing some unit file, and I get a warning about it when doing systemctl restart ***.service.

Why it was decided to only issue a warning instead of reloading the unit automatically? (the warning happens, so change was detected and so it is possible to simply auto-reload the file).

Answer

It appears to be a specific design choice, based around race conditions and the complexity of reading the entire conf tree.

However, one approach is to use systemctl edit, which triggers a unit reload after it exits.

Some discussion of the issue here, and here.

We are here to answer your question about Why can’t systemd reload unit files automatically? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji