[PATCH] gkrellmd doesn't play nicely with autofs

Gerard Neil <[email protected]> Wed, 16 May 2012 05:04:32 +1000
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <CAJJ0ynfMhsnfmB_mWq0sLxeAmyMi9B3TmLQi-z2z65STFOnKpQ@mail.gmail.com>
Under linux, running gkrellmd in combination with autofs will force
all auto-mounted filesystems to be mounted, and to stay mounted or
repeatedly unmount and remount.

Mount table entries of type "autofs" represent mount points under
control of the automount daemon; if the mount point directory is
accessed, then the daemon causes a real filesystem mount to occur.
After such an auto-mount, there will be two entries in the mount
table, one of type "autofs" and one for the newly mounted filesystem.

gkrellmd periodically scans mount points to support the filesystem
free-space monitoring. It treats mount points of type "autofs" as real
filesystems and attempts to determine their free space. This access
causes an automount to occur. If autofs has been configured to
automatically unmount after a timeout, then the gkrellmd polling will
either prevent the unmount occurring, or cause repeated mount, unmount
cycles, depending on the exact configuration.

The solution is trivial, simply ignore filesystems of type "autofs"
during filesystem polling.

Note that with this fix gkrellmd will still happily report on already
auto-mounted filesystems through their real mount entries, it just
won't cause the auto-mounts to occur. If the user wants to allow these
filesystems to auto-unmount, they must be careful to configure
gkrellmd's (n)fs-interval to be larger than twice the auto-unmount time.

-------------------------------------

--- gkrellm-2.3.5.old/src/sysdeps/linux.c 2010-10-06 03:27:33.000000000 +1100
+++ gkrellm-2.3.5/src/sysdeps/linux.c 2011-11-24 02:07:30.926450485 +1100
@@ -1439,6 +1439,7 @@
  || !strcmp(type, "usbdevfs")
  || !strcmp(type, "usbfs")
  || !strcmp(type, "sysfs")
+ || !strcmp(type, "autofs")
    )
  continue;
  /* Strip trailing / from the directory.

______________________________________________
Gkrellm mailing list
[email protected]
Read archives-join-leave-set RSS feed:
http://archive.lists.netservicesgroup.com
This service is provided by The Network Services Group:
http://www.netservicesgroup.com