[systemd-devel] RequiresMountsFor and the noauto option.

Lennart Poettering lennart at poettering.net
Mon Feb 6 20:38:13 UTC 2017


On Mon, 23.01.17 11:13, NeilBrown (neilb at suse.com) wrote:

> 
> hi,
>  according to "man systemd.unit" :
> 
>        RequiresMountsFor=
>            Takes a space-separated list of absolute paths.
>            Automatically adds dependencies of type Requires= and
>            After= for all mount units required to access the
>            specified path.
> 
>            Mount points marked with noauto are not mounted
>            automatically and will be ignored for the purposes of
>            this option. If such a mount should be a requirement for
>            this unit, direct dependencies on the mount units may be
>            added (Requires= and After= or some other combination).

Hmm, this is weird. This is actually not what happens. The
documentaiton is simply not correct here. That's a bug we need to
fix. I filed a bug about this now:

https://github.com/systemd/systemd/issues/5249

What actually happens is that RMF= adds After= for all prefix mount
units, but Requires= only to those which have a fragment file
(i.e. are explicitly configured). The "noauto" flag is not checked.

Sorry for the confusion.

>  If the documentation is wrong, and the code is correct, would it be
>  possible to get "AfterMountsFor=" as that is the functionality that I
>  really want.

I figure we could add that. Please file an RFE on github.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list