[systemd-devel] Is it safe to issue "systemctl daemon-reload" during boot?

Thorsten Schöning tschoening at am-soft.de
Fri May 4 14:32:55 UTC 2018


Hi all,

I'm using Ubuntu 16.04 LTS server with BTRFS, which created one
subvolume for / and another one for /home. For various reasons I'm
storing systemd service files in different folders underneath /home
and provide them to systemd using "systemctl enable ..." with the
absolute path to the file.

This approach doesn't work during boot, because /home is mounted after
systemd recognized its service files in "/etc/systemd/systemd". After
boot, "systemctl status ..." with one of my services tells that the
service is not loaded because the file is not found.

One way to work around that seems to be using user configs. Another
thing I just tested is creating foo.path and foo.service in /, while
foo.path observes that /home/... is available. If thats the case,
foo.service is started and issues a "systemctl daemon-reload". That at
least allows all the services formerly not loaded to be properly
loaded. The only thing missing is starting the services, but that
could be managed in some script or whatever.

While this works in my test-VM, the docs regarding this command read
a bit scary:

> Reload the systemd manager configuration. This will rerun all
> generators (see systemd.generator(7)), reload all unit files, and
> recreate the entire dependency tree.

Could executing "daemon-reload" during boot break things terribly or
could this be considered somewhat safe?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening at AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



More information about the systemd-devel mailing list