[systemd-devel] Question about mount unit generators

Lennart Poettering lennart at poettering.net
Fri Aug 3 11:48:40 PDT 2012


On Wed, 25.07.12 11:28, Manuel Amador (Rudd-O) (rudd-o at rudd-o.com) wrote:

> As you can tell from my code:
> 
> https://github.com/Rudd-O/zfs/blob/master/systemd/systemd-zfs-generator.in
> 
> I carefully calculate dependencies so the file systems are mounted in
> the correct order.
> 
> Now that fstab unit generation is moving to a generator, I read the code
> in systemd.git.  I discovered it does not calculate dependencies (what
> file systems to mount first) at all.  It just sets very simple befores=
> and afters=.
> 
> However, the proper dependencies DO show when I do systemctl show (resp.
> mount unit).
> 
> Thus my question:
> 
> Would it be correct to say that the generator I wrote absolutely does
> not need to calculate parent file system dependencies, because some
> black magic inside systemd / systemctl knows to figure out the parent
> file system dependencies thus guarantees mounting in the right order??
> 
> Thanks in advance.

Yes, as Zbigniew pointed out, we implicitly and always add the
inter-mount deps for mounts that lie below other mounts.


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list