[systemd-devel] How to add a unit path to systemd?

Filipe Brandenburger filbranden at google.com
Thu Aug 9 19:33:33 UTC 2018


On Thu, Aug 9, 2018 at 10:21 AM Daniel Wang <wonderfly at google.com> wrote:
> I want to append to systemd's unit search path a directory on my OEM partition, which is mounted  by a .mount unit, at /usr/share/. I will be putting unit files in that partition, some of which I want to run before default.target. Is it possible to do so without a systemctl daemon-reload?
>
> I understand I could configure systemd at compile time, or use the SYSTEMD_UNIT_PATH env var at the kernel command line, but since /usr/share/ is probably mounted _after_ default.target is first referenced (?), they won't do what I need?

All the unit files need to be available at early boot, so if they're
coming from a separate partition, the partition needs to be mounted
before systemd starts (i.e. from the initramfs.)

See here for more details:
https://github.com/systemd/systemd/issues/8307#issuecomment-369298082

Cheers,
Filipe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4851 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180809/320aca4f/attachment.bin>


More information about the systemd-devel mailing list