All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gordon Lack" <gml4410@ggr.co.uk>
To: autofs@linux.kernel.org
Subject: -hosts and -null enabling for autofs v4.1.x
Date: Fri, 07 Jul 2006 16:02:29 +0100	[thread overview]
Message-ID: <44AE7785.74E63D70@ggr.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

   Here is a simple patch to the system autofs startup script so that
-hosts and -null is enabled in autofs 4.1.x.  This patch is actually
against a RedHat autofs, but the same code is present in
samples/rc.autofs.in.

   For -hosts, it just translates the map name to /etc/auto.net if that
is present and executable.

   For -null, it just adds the mountpoint location to the list of
knownmaps, but doesn't do anything else.


PS:  I see that v5 handles these anyway.  However, this note in
README.v5.release looks ominous...

==========
- a "hosts" map module has been added
  - an entry like "/net -hosts" is now understood and uses the new
    multi-mount semantics for lazy mount/umount of exports from the
host.
  - the implementation is quite simple minded at this stage and will
need
    refinment. It just iterates through the host table and addes any
host
    names it finds to the internal map.
==========

Some of us have thousands of hosts in a host map, eg:

systemx*[1] ypcat -k hosts | wc -l
   30899

[-- Attachment #2: autofs.diffs --]
[-- Type: text/plain, Size: 1094 bytes --]

*** autofs.orig	2006-07-07 08:56:05.000000000 -0400
--- autofs	2006-07-07 09:25:57.000000000 -0400
***************
*** 191,197 ****
  	    dir=`echo "$dir" | sed -e "s/\/*$//"`
  
  	    if [ ! -z "$map" -a "$map" = "-hosts" ] ; then
! 		continue
  	    fi
  	    if [ $DISABLE_DIRECT -eq 1 \
  			-a x`echo $dir | grep -E "^/-"` != 'x' ]
--- 191,201 ----
  	    dir=`echo "$dir" | sed -e "s/\/*$//"`
  
  	    if [ ! -z "$map" -a "$map" = "-hosts" ] ; then
!                 if [ -x '/etc/auto.net' ]; then
!                     map='/etc/auto.net'
!                 else
!                     continue
!                 fi
  	    fi
  	    if [ $DISABLE_DIRECT -eq 1 \
  			-a x`echo $dir | grep -E "^/-"` != 'x' ]
***************
*** 210,215 ****
--- 214,224 ----
  		fi	
  	    done
  
+             if [ "$map" = '-null' ]; then
+ # Just add dir to list of those with a known map, but do nothing else
+                 knownmaps=" $dir/ $knownmaps"
+                 continue
+             fi
  	    if [ ! -z "$dir" -a ! -z "$map" \
  			-a x`echo "$map" | cut -c1` != 'x-' ]
  	    then

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

             reply	other threads:[~2006-07-07 15:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 15:02 Gordon Lack [this message]
2006-07-13 13:10 ` -hosts and -null enabling for autofs v4.1.x Ian Kent
2006-07-13 13:42 ` Jeff Moyer
2006-07-14 11:33   ` Gordon Lack
2006-07-14 13:31     ` Jeff Moyer
2006-07-14 15:58       ` Gordon Lack
2006-08-07  6:56         ` Ian Kent
2006-08-22 14:03 ` Bug (and patch) in autofs init.d script (v4.1.4) Gordon Lack
2006-08-22 14:18 ` Enhancement patch for autofs v4.1.4 init.d script Gordon Lack
2006-09-08 11:31   ` Bug in autofs v4.1.4 init.d script (and fix) Gordon Lack
2006-09-12 12:58     ` Bug in autofs v4.1.4 init.d script for reload " Gordon Lack
2006-09-13  9:42       ` Gordon Lack
2006-11-10 11:58 ` autofsv5 bug. Non-existent dirs get "mounted"! Gordon Lack
2006-11-10 12:05   ` autofsv5 enhancement - map names in /proc/mounts Gordon Lack
2006-11-10 17:33     ` autofsv5 - mouting files (not dirs) Gordon Lack
2006-11-11  2:58       ` Ian Kent
2006-11-11  2:53     ` autofsv5 enhancement - map names in /proc/mounts Ian Kent
2006-11-13 10:09       ` Gordon Lack
2006-11-13 15:44         ` Ian Kent
2006-11-13 16:58           ` Gordon Lack
2006-11-14  2:00             ` Ian Kent
2006-11-14 10:00               ` Gordon Lack
2006-11-14 11:42                 ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44AE7785.74E63D70@ggr.co.uk \
    --to=gml4410@ggr.co.uk \
    --cc=autofs@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.