Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Can you please tell us the exact version of the used autofs package? –  Valentin Jun 30 '12 at 12:17

2 Answers 2

up vote 3 down vote accepted
+100

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.