fstab-generator: extra dependencies specified in fstab should be applied to the mount...
authorFranck Bui <fbui@suse.com>
Thu, 11 Jun 2020 07:41:14 +0000 (09:41 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Jul 2020 08:26:33 +0000 (10:26 +0200)
commitbc740e3df2818362501e49716924e8db55cd3c9f
tree1ef6329bc8b30e48d364bf0541cdee3b34c38e6b
parentdb8b6a87e978800911621964a676fef6df567d93
fstab-generator: extra dependencies specified in fstab should be applied to the mount unit

If an entry in fstab uses "x-systemd.automount" option and also asks for
additionnal dependencies via x-systemd.requires or such, then the dependencies
were applied to the automount unit.

But this unlikely to do the right thing and is inconsistent with what's done
for network mounts.

Indeed when an fstab entries has "_netdev,x-systemd.automount" options, the
dependencies against the network requested by "_netdev" are (correctly) applied
to the mount unit only and the automount unit remains ordered against
local-fs.target.

The same logic should be followed when extra deps are specified via the mount
options as automount units should always be ordered against local-fs.target.

Note: in general explicit deps specified via mount options should be used with
care and should be used to specify dependencies on other mount units only as it
can easily create ordering cycles otherwise like it's been seen in
https://github.com/systemd/systemd-stable/issues/69. Mount units (as well as
automount ones) are ordered before local-fs.target by default which is a
low-level target that most other units depend on.

(cherry picked from commit 045c5faf5a3ef51cd39f738694e06c11a73f54b7)
man/systemd.mount.xml
src/fstab-generator/fstab-generator.c