Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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