diff options
author | Colin Walters <walters@verbum.org> | 2017-07-11 18:48:57 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-07-11 18:48:57 +0200 |
commit | 634735b56b82bdde3c67193ba7b470bab80fdcbd (patch) | |
tree | 557e01b8d5e2ced28a9ff8df13f02e13a482661b /man/systemd-fstab-generator.xml | |
parent | bootctl: allow non-root user to run `bootctl status` (#5964) (diff) | |
download | systemd-634735b56b82bdde3c67193ba7b470bab80fdcbd.tar.xz systemd-634735b56b82bdde3c67193ba7b470bab80fdcbd.zip |
fstab-generator: Chase symlinks where possible (#6293)
This has a long history; see see 5261ba901845c084de5a8fd06500ed09bfb0bd80
which originally introduced the behavior. Unfortunately that commit
doesn't include any rationale, but IIRC the basic issue is that
systemd wants to model the real mount state as units, and symlinks
make canonicalization much more difficult.
At the same time, on a RHEL6 system (upstart), one can make e.g. `/home` a
symlink, and things work as well as they always did; but one doesn't have
access to the sophistication of mount units (dependencies, introspection, etc.)
Supporting symlinks here will hence make it easier for people to do upgrades to
RHEL7 and beyond.
The `/home` as symlink case also appears prominently for OSTree; see
https://ostree.readthedocs.io/en/latest/manual/adapting-existing/
Further work has landed in the nspawn case for this; see e.g.
d944dc9553009822deaddec76814f5642a6a8176
A basic limitation with doing this in the fstab generator (and that I hit while
doing some testing) is that we obviously can't chase symlinks into mounts,
since the generator runs early before mounts. Or at least - doing so would
require multiple passes over the fstab data (as well as looking at existing
mount units), and potentially doing multi-phase generation. I'm not sure it's
worth doing that without a real world use case. For now, this will fix at least
the OSTree + `/home` <https://bugzilla.redhat.com/show_bug.cgi?id=1382873> case
mentioned above, and in general anyone who for whatever reason has symlinks in
their `/etc/fstab`.
Diffstat (limited to 'man/systemd-fstab-generator.xml')
-rw-r--r-- | man/systemd-fstab-generator.xml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/man/systemd-fstab-generator.xml b/man/systemd-fstab-generator.xml index 50d24d67f0..b898d719f2 100644 --- a/man/systemd-fstab-generator.xml +++ b/man/systemd-fstab-generator.xml @@ -71,6 +71,14 @@ for more information about special <filename>/etc/fstab</filename> mount options this generator understands.</para> + <para>One special topic is handling of symbolic links. Historical init + implementations supported symlinks in <filename>/etc/fstab</filename>. + Because mount units will refuse mounts where the target is a symbolic link, + this generator will resolve any symlinks as far as possible when processing + <filename>/etc/fstab</filename> in order to enhance backwards compatibility. + If a symlink target does not exist at the time that this generator runs, it + is assumed that the symlink target is the final target of the mount.</para> + <para><filename>systemd-fstab-generator</filename> implements <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> </refsect1> |