Because of a show-stopping bug in Debian autofs 4, I just upgraded to autofs5.
It is not honoring the timeout option in my auto.master
file:
/var/autofs/removable /etc/auto.removable --timeout=2
I use this map for thumb drives and so on; I don't want a general default timeout of 2 seconds.
I did some digging and although the --timeout
option worked in autofs 4, and it appears in some examples on the Web, it is not actually sanctioned (or even mentioned) in the documentation for the auto.master
file. So I don't feel I can report the problem as a bug.
How can I get autofs5 to timeout after 2 seconds only on designated filesystems?
Update: I am using a Debian-packaged autofs5, version 5.0.4-3.2.
Edit: the rest of my answer is mostly off-topic. You're doing it the right way, but the feature was only introduced in
autofs
5.0.6. From the git repository:Unfortunately only maps can have a custom timeout (overwriting the
automount(8)
one using--timeout
), not entries themselves.This limitation goes down as low as the Linux kernel itself, which only offers an
AUTOFS_DEV_IOCTL_TIMEOUT_CMD
ioctl
perautofs
filesystem, applied on all its mounts. You can find more information inDocumentation/filesystems/autofs4-mount-control.txt
in the kernel sources.The best solution I can suggest is to split your entries by timeout into separate maps. This unfortunately means that you'll have different parent directories for your mounts.
If that's a big problem, you could look into UnionFS or similar, but there is no such feature in the official Linux kernel.
--timeout=n wasn't always implemented in autofs version 5. Try using -t n instead.