[systemd-devel] Again, why this strange behavior implied by "auto" in fstab ?

Uoti Urpala uoti.urpala at pp1.inet.fi
Thu Jan 25 17:33:05 UTC 2018


On Thu, 2018-01-25 at 15:40 +0100, Franck Bui wrote:
> Sorry I was probably not clear: by "do the equivalent of "mount -a"
> during boot only" I meant to mount fs listed in fstab  (without
> "noauto")  the way it's done currently by systemd during boot.
> 
> During boot there shouldn't be any changes. The behavior change happens
> later if neither "auto" nor "noauto" is specified: by default do not try
> to automagically mount filesystems.

This would require distinguishing "boot" and "non-boot" modes of
operation, so that systemd could switch mount handling behavior at some
point. How would you define where "boot" ends? You could try a
definition like "boot is over if there is no unit that is scheduled for
start and has been since the initial transaction", but then if you have
some obscure service that takes 5 hours to start, this could still lead
to very surprising sudden behavior changes on a system that has
otherwise been running for hours...

And if you define boot based on when some software has completed
starting, and have any mounts which are not necessary for boot to
succeed, then there's an obvious race condition - sometimes the devices
would become visible and be mounted during boot, sometimes the boot
would complete first and the devices would not be mounted
automatically. I doubt that would be what you'd want. I think this
issue makes your "only during boot" goal a bad idea in general for such
non-essential mounts.

For mounts that are required as part of the initial transaction, some
kind of "only mount this automatically if it has not been mounted
before" logic (rather than based on "is it boot" directly) is the
closest I can think of to a sane feature. But still not something that
I'd consider a particularly good idea.



More information about the systemd-devel mailing list