Nicolas Williams
2006-Apr-26 16:28 UTC
[zfs-discuss] Workaround for lack of client-side crossing of NFSv4 server-side mountpoints
Attached is an executable automount map that emulates the -hosts special map, except that automountd updates executable automount map entries much more often than -hosts ones (not at all). So now I can see ZFS filesystems show up or disappear in /znet/<servername>/... dynamically. Only problem: automountd(1M) limits map entries to 4095 characters (so this doesn''t work for borg :/). This crappy limit comes from $SRC/cmd/fs.d/autofs/automount.h: #define LINESZ 4096 So, you can put this in your /etc/auto_master: /znet auto_zhosts -nosuid,nobrowse And the attached script in /etc/auto_zhosts (don''t forget to chmod +x). Cheers, Nico -- -------------- next part -------------- #!/bin/ksh exec 2>/dev/null if [[ $# -eq 0 ]] then logger -p daemon.error -t ${0##*/} "Incorrect usage by automountd!" exit 1 fi entry="/ $1:/" showmount -e $1|sort|grep ''^/''|while read p junk do entry="$entry $p $1:$p" done print "$entry" logger -p daemon.debug -t ${0##*/} "$entry"