0

The setup (not autofs, but systemd based automount):

# grep automount /etc/fstab
1.2.3.4:/vol/homedirs /home/roaming nfs x-systemd.automount,x-systemd.idle-timeout=30

and:

# systemctl daemon-reload

on SLES12.3.

This works great! If a user logs in, having "/home/roaming/someuser123" homedir, the /home/roaming gets automatically mounted. it wasn't mounted before.

The question: after user logs out, the "/home/roaming" never gets umounted! Why? The "x-systemd.idle-timeout=30" syntax looks good!

UPDATES:

# systemctl status automount
? automount.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
#
4
  • Please show the automount unit if you have one. Commented Oct 13, 2020 at 16:43
  • updated the question! Thanks.
    – pintereric
    Commented Oct 13, 2020 at 16:48
  • I am the first one who wants to use autofs/automounts timeout function? :)
    – pintereric
    Commented Oct 14, 2020 at 9:55
  • You didn't have a generated automount unit for your mount point? I see that for some reason you ran systemctl status automount but I don't know why, as that doesn't exist and isn't what I asked for. Look in /run/systemd/generator for a unit corresponding to your automount, for example home-roaming.automount. Commented Oct 14, 2020 at 15:40

1 Answer 1

1

This approach worked for me (on Ubuntu):

  1. Clean start: make sure the mount point is not mounted yet.
  2. Have the mount defined in your /etc/fstab
  3. sudo systemctl daemon-reload
  4. sudo systemctl restart remote-fs.target

To check if it works:

At this point if you didn't access the remote filesystem yet, systemctl status home-roaming.mount should report Loaded: loaded and Active: inactive (dead). Next, access the filesystem, with e.g. ls /home/roaming. Rerunning the above status query should now report Active: active (mounted). If the mount point is truly not accessed by the system after the user logs out, it should get umounted after the idle timeout, with corresponding active status. If not, I would try next with a mount point that is not a user homedir to see if it makes a difference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .