linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RequiresMountsFor and the noauto option.
@ 2017-01-23  0:13 NeilBrown
  2017-01-23  4:10 ` [systemd-devel] " Andrei Borzenkov
  2017-02-06 20:38 ` Lennart Poettering
  0 siblings, 2 replies; 4+ messages in thread
From: NeilBrown @ 2017-01-23  0:13 UTC (permalink / raw)
  To: systemd-devel, List Linux NFS Mailing

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]


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).


 I understand this to mean that if a mount point has the "noauto" option in
 /etc/fstab, and if a systemd service has RequiresMountsFor the path to
 that mount point, then the service will *not* require the mount point,
 and it will start even if that mountpoint cannot be mounted.

 I recently made a change to nfs-utils to make use of this
 functionality.  A generator creates RequiresMountsFor dependences for
 nfs-server so that it won't start until all exported filesystems
 (listed in /etc/exports) are mounted.  I assumed this would not trigger
 the mounting of filesystems marked as "noauto".  I really want After
 functionality, but not Requires.

 However, this is not how it works.

 The "noauto" option stops a "Requires" dependency being created for
 local-fs.target, but does not stop a "Requires" dependency being
 created for a service which "RequiresMountsFor".  There is no checking
 for "noauto" in unit_add_mount_dependencies().

 If this a bug in the documentation, or a bug in the code?  I'm hoping
 the later, otherwise I'll need to find a different solution for
 nfs-utils, and that will probably require having my generator read
 /etc/fstab and duplicate the work of fstab-generator.c

 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.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-06 20:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-23  0:13 RequiresMountsFor and the noauto option NeilBrown
2017-01-23  4:10 ` [systemd-devel] " Andrei Borzenkov
2017-01-23  5:18   ` NeilBrown
2017-02-06 20:38 ` Lennart Poettering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).