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

Daniel Wang wonderfly at google.com
Fri Aug 10 17:10:11 UTC 2018


> Alternatively, you actually can issue daemon reload during the
boot process

Suppose I use a systemd service (say foo.service) to do this, is it a
supported/recommended practice to do a daemon reload as part of a unit's
activation (i.e., through its ExecStart)?
I want my new units to block default.target. Is it safe to issue a
`systemctl start default.target` with foo.service' ExecStart or
ExecStartPost?


On Fri, Aug 10, 2018 at 3:30 AM Lennart Poettering <lennart at poettering.net>
wrote:

> On Do, 09.08.18 10:20, Daniel Wang (wonderfly at google.com) wrote:
>
> > Hi,
> >
> > 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?
>
> /usr/share appears like a surprising place for this…
>
> In general, in systemd the assumption is that unit files are available
> during earliest boot, so that the initial transaction can be
> calculated with all units taken into account. Hence a relatively clean
> solution might be to mount your partition already in the initrd, so
> that systemd sees it in place already.
>
> Alternatively, you actually can issue daemon reload during the boot
> process, but you'd have to enqueue the new units appearing explicitly,
> i.e. trigger a second transaction because what isn't there won't be
> considered in the initial one.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>


-- 
Best,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180810/c6218b39/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4849 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180810/c6218b39/attachment.bin>


More information about the systemd-devel mailing list