How to configure autofs5 timeout on per-filesystem basis?
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:
Author: Ian Kent Date: Fri May 25 12:28:56 2012 +0800
autofs-5.0.6 - move timeout to map_source Move the map entry timeout field from "struct autofs_point" to "struct map_source". The result of this change is that an individual timeout may be set for each direct map master map entry.
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
per autofs
filesystem, applied on all its mounts. You can find more information in Documentation/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.