[systemd-devel] Unit files on another partition

Lennart Poettering lennart at poettering.net
Tue Feb 3 13:28:35 PST 2015


On Fri, 12.12.14 16:06, D.S. Ljungmark (spider at aanstoot.se) wrote:

Sorry for the late reply, and resurrecting this old thread, I am still
busy processing the remaining unanswered mails and patches from the
last months.

I think we talked about this at FOSDEM quickly now?

Anyway:

> hi,
>   Our / partitions are on a squashfs media, which means that unit files
> are read-only. There is a partition for read-write content
> (Scratchable), and I'm wondering if it would be possible to add
> unit-files there and have the boot order cope with this correctly?

Not really. systemd is kinda designed to calculate an initial
transaction that is as complete as possible as early as possible. If
you have units not mounted then they cannot be taken into
consideration.

Two options:

a) You pre-mount your unit dir filesystem in your initrd before
   transitioning into the host OS, so that the host's systemd has all
   unit files accessible from the first instant on.

b) You reload configuration once during boot, after you mounted the
   unit dir fs.

I think a) is the nicer solution. generally we try to keep reloads out
of the default code paths, since they are slow and ugly, but that's
just the default code paths, local setups are welcome to add reloads
where necessary.

Minor caveat: currently, if you have a Type=oneshot service with
multiple ExecStart= lines issuing the reload might have the result
that we execute some lines multiple times, because there's not clear
way to know where to continue execution in that case...

Hope this is still useful,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list