[Bug 1316125] Re: Autofs leak file descriptors when reloaded (-HUP) and daemon may stop working on high # of shares/reloads

Rafael David Tinoco rafael.tinoco at canonical.com
Mon Sep 29 18:32:54 UTC 2014


# verification-precise

inaddy at precise.1315535:~$ sudo mkdir /nfs.server
inaddy at precise.1315535:~$ sudo mkdir /nfs.client

inaddy at precise.1315535:~$ sudo vi /etc/exports 
inaddy at precise.1315535:~$ sudo service nfs-kernel-server restart

inaddy at precise.1315535:~$ sudo vi /etc/auto.master 
inaddy at precise.1315535:~$ sudo vi /etc/auto.direct

inaddy at precise.1315535:~$ sudo service autofs restart
autofs stop/waiting
autofs start/running, process 2234

inaddy at precise.1315535:~$ cat /etc/auto.direct 
/nfs.client localhost:/nfs.server
#/nfs.client/dir01 localhost:/nfs.server
#/nfs.client/dir02 localhost:/nfs.server

inaddy at precise.1315535:~$ sudo mkdir /nfs.server/dir01
inaddy at precise.1315535:~$ sudo mkdir /nfs.server/dir02

inaddy at precise.1315535:~$ ls /nfs.client/
dir01  dir02
inaddy at precise.1315535:~$ sudo vi /etc/auto.direct 

# change auto.direct

inaddy at precise.1315535:~$ sudo kill -HUP $(pidof automount)
inaddy at precise.1315535:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
inaddy at precise.1315535:~$ sudo vi /etc/auto.direct 
inaddy at precise.1315535:~$ ls /nfs.client/dir01
dir01  dir02
inaddy at precise.1315535:~$ ls /nfs.client/dir02
dir01  dir02
inaddy at precise.1315535:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01

# final test

inaddy at precise.1315535:~$ sudo kill -HUP $(pidof automount)
inaddy at precise.1315535:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01
inaddy at precise.1315535:~$ sudo kill -HUP $(pidof automount)
inaddy at precise.1315535:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01

# verification-done-precise

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to autofs in Ubuntu.
https://bugs.launchpad.net/bugs/1316125

Title:
  Autofs leak file descriptors when reloaded (-HUP) and daemon may stop
  working on high # of shares/reloads

Status in “autofs” package in Ubuntu:
  Fix Released
Status in “autofs5” package in Ubuntu:
  Invalid
Status in “autofs5” source package in Precise:
  Fix Committed
Status in “autofs” source package in Saucy:
  Fix Committed
Status in “autofs” source package in Trusty:
  Fix Committed

Bug description:
  [Impact]

   * Autofs leak file descriptors when reloaded (-HUP) and daemon may
  stop working on high # of shares/reloads.

  [Test Case]

  1. Configure a simple direct mount:

  # cat /etc/auto.master
  /-	/etc/auto.direct

  # cat /etc/auto.direct
  /nfs	server:/nfs

  2. Start the automounter and do NOT trigger the mount

  3. Replace /etc/auto.direct with:

  # cat /etc/auto.direct
  /nfs/1	server:/nfs
  /nfs/2	server:/nfs

  4. Reload:

  # kill -HUP $(pidof automount)

  >From now on, every reload will leak a file descriptor:

  # ls -la /proc/$(pidof automount)/fd | grep /nfs

  lr-x------ 1 root root 64 Aug 14 22:08 11 -> /nfs
  lr-x------ 1 root root 64 Aug 14 22:08 12 -> /nfs
  lr-x------ 1 root root 64 Aug 14 22:08 13 -> /nfs
  lr-x------ 1 root root 64 Aug 14 22:08 14 -> /nfs
  lr-x------ 1 root root 64 Aug 14 22:08 5 -> /nfs

  [Regression Potential]

   * based on upstream commit: autofs - version 5.0.7 - dd66c61a - file
  descriptor leak when reloading automount daemon. Tested with the same
  test case fix the error and not changing any other behavior.

  [Other Info ]

  -

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1316125/+subscriptions



More information about the foundations-bugs mailing list