7

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.

Norman Ramsey
  • 645
  • 2
  • 10
  • 24

2 Answers2

4

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.

Pierre Carrier
  • 2,607
  • 17
  • 28
0

--timeout=n wasn't always implemented in autofs version 5. Try using -t n instead.

PythonLearner
  • 1,022
  • 2
  • 12
  • 29