i have this auto.master:

/data         yp:my_nis_map

on a particular linux workstation, i like to add a /data/special that is not present in my_nis_map.

/data         yp:my_nis_map
/data/special filer:/path/to/special

but this fails ? How can i concatenate two entries ? I can't modify the NIS or the NFS exports.

Thansk.

link|improve this question

64% accept rate
feedback

1 Answer

The maps cannot overlap. You could mount filer:/path/to/special somewhere else an make a symlink from /data/special to it. That symlink will be visible to all clients however.

A cleaner though more involved approach would be to use an executable map. The map script would be something like:

#!/bin/sh

KEY="$0"
if [ "$KEY" = "/data/special" ]; then
  echo " filer:/path/to/special"
  exit 0
fi

ypcat -k my_nis_map | egrep "^$KEY\s+" | sed "s/^$KEY//"
exit 0

(Warning: Script typed off the top of my head. NIS map musn't use \ for line continuation. I do not have access to NIS. May contain peanuts.)

Edit: http://phaq.phunsites.net/2008/01/24/an-autofs-executable-map-to-automount-device-nodes/ gives an example of an executable map.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.