I recently found that (among others) network shares can be automatically mounted on access. In Ubuntu there are two options either using autofs or the automount feature of systemd.
Could perhaps someone tell me what the differences (apart from different configuration) between the two options are. Autofs seems to be more flexible as one can configure scripts for the automount locations. Is this possible using the systemd automount as well?
Just a brief update for everyone stumbling across this question.
I went with the systemd automount option as it is way more convenient and easier to configure, while providing nearly the same functionality.
If there is an fstab entry with
x-systemd.automount reloading the systemd daemon (
systemctrl daemon-reload) will generate an automount systemd unit under
/run/systemd/generator/ (at least this is the path where it get's generated under ubuntu 16.04). The unit will be named after the mountpoint of the fstab entry. That is, if you create an automountpoint for
/media/network/someserver/share there will be a systemd automount unit
media-network-someserver-share.automount. This automount unit can then be (re-)started to activate the mountpoint using
systemctl restart media-network-someserver-share.automount.
And you're done.