On Mon, Jul 27, 2020 at 08:27:24PM +0100, Tomasz Kłoczko wrote:
On Mon, 27 Jul 2020 at 20:05, Zbigniew Jędrzejewski-Szmek
<zbyszek(a)in.waw.pl>
wrote:
[..]
> > So (a bit off-topic) what was wrong with autofs as a separate small
> process
> > started only when it was necessary? Do you remember that?
>
> Having automount support directly in pid1 allows automounts to be part
> of the unit graph — with dependencies and triggering and failure actions.
> The code to talk to the kernel interface is rather simple. The part
> to tie into the rest of the unit framework is bigger. Having a separate
> daemon would only make that bigger part even more complicated.
>
Still it does not explain why automonting cannot be just a regular unit
with a separated process.
That way it still can be part of the "the unit graph", and both systemd
units and SMF services are using dependencies.
As communication with kennel space is done over /de/autofs and just checked
and autofs and systemd are using that interface almost the same way.
It probably could. The general reason to keep things built into pid1
is that the code to communicate state to the separate process and failure
back to the main process would be more code than the actual "business logic"
running in the separate process. But let's not discuss this here — if
we start discussing systemd design, we'll have another megathread on
fedora-devel, and I don't think anyone wants that. systemd-devel is
a more appropriate place.
At the moment it seems that the autofs bit is used only to mout per
logged
user tmpfs which looks like it could be mounted/umounted using the user
systemd unit WITHOUT automounter. Am I right? If yes, using the automonter
is kind of overkill because all that could be done without autofs. Instead
have in kernel autofs and in userspace communication over /dev/autofs thi
could be done with a top 0.5KB systemd unit yext file which will execute
mount/umount commands with some exact params.
It is also used for anything which has x-systemd.automount, so the list is
open-ended.
Zbyszek