[RFC] mount: support /etc/fstab.d/* files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello util-linux-ng@:

I administrate a fair bit of systems with SCM software like cfengine, chef, and puppet. When using these suites to administrate and provision mountpoints, they all do the same trick to "UPSERT" mountpoints into /etc/fstab: grep for an exisitng definition of a SCM controlled mountpoint or device and replace the line if found, else append to the file a new line defining the mountpoint plus commented garbage or no-op options to let the admin/SCM know that this is a "managed" entry (in an "unmanaged" file).

I find this messy and increasingly unsustainable when managing mountpoints for _many_ applications and users. Usually an SCM prefers that you completely regenerate configuration files from a template rather than incrementally mangling an "unmanaged" file. Since most SCM users don't manage every single mountpoint in fstab in their SCM "policy", /etc/fstab itself can't be generated from a template without risking trashing SCM-unmanaged entries.

I'd like mount to support reading /etc/fstab.d/*. in addition to /etc/fstab.
Some files could be dedicated for SCM, or so-and-so user/program whilst /etc/fstab remains the place for critical boot-time mountpoints that don't ever need (automated) changing. The cygwin environment's mount program is already using an /etc/fstab.d directory in conjunction with a typical /etc/fstab file:
http://cygwin.com/cygwin-ug-net/using.html#mount-table
http://www.cygwin.org/cygwin/cygwin-ug-net/using-specialnames.html

Since altering libc to parse such a directory for getfsent(), getfsspec(), and getfsfile() is out of the question (which is what I assume cygwin.dll is doing), I was wondering if the mount program could instead get this logic (in mount/fstab.c:read_fstab() I presume).

The directory could be walked as default behavior: `mount /mnt/foo` or `mount -a`
  - parse /etc/fstab for desired mountdev/point
  - then parse /etc/fstab.d/* (nat-sorted)
or as demanded by an optionflag:
 `mount --fstab=/etc/fstab.d/myDB /mnt/myDB` or `mount -a --fstab=/etc/fstab.d/SCM`
  -only parse /etc/fstab.d/myDB

I see no need to keep fstab.d mounts out of /etc/mtab and breaking all of the getmnt*() calls for such mounts.

Now there are automounter suites and that can provide such a tiered configuration, but I find running an automounter daemon excessive (for such a simple chore) and an unnecessary kernel<>userland performance drag for highly-utilized local filesystems. I'd much rather use a simple one-time initscript that will run mount with the appropriate options to iterate my fstab.d files, or just `mount -a`.

An alternative to pathcing bin/mount is to run a wrapper script in place of it that implements all fstab parsing and merely calls mount(). But why keep that to myself and mangle every SCM I have to use such wrapper?

Thanks for reading
-joey
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux