| 1 |
Descriptionscip-debian debian autofs 5.1.9-1.2 autofs/patches/`fix-nfs4-mounts-in-auto-net.patch`#Description.: Fix nfs4/nfs mounting via autofs in auto.net. |
| 2 |
Authorscip-debian debian autofs 5.1.9-1.2 autofs/patches/`fix-nfs4-mounts-in-auto-net.patch`#Author.: David Mohr <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 3 |
|
| 4 |
--- a/samples/auto.netscip-debian debian autofs 5.1.9-1.2 autofs/upstream/`samples/auto.net`: |
| 5 |
+++ b/samples/auto.netscip-debian debian autofs 5.1.9-1.2 autofs/upstream/`samples/auto.net`: |
| 6 |
@@ -11,29 +11,44 @@ |
| 7 |
# add "nonstrict" to make it OK for some filesystems to not mount |
| 8 |
# choose one of the two lines below depending on the NFS version in your |
| 9 |
# environment |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
+[ -f /etc/default/autofs ] && . /etc/default/autofs |
| 17 |
+ |
| 18 |
+if [ -z "$MOUNT_NFS_DEFAULT_PROTOCOL" -o "$MOUNT_NFS_DEFAULT_PROTOCOL" == "3" ]; then |
| 19 |
+ # Showmount comes in a number of names and varieties. "showmount" is |
| 20 |
+ # typically an older version which accepts the '--no-headers' flag |
| 21 |
+ # but ignores it. "kshowmount" is the newer version installed with knfsd, |
| 22 |
+ # which both accepts and acts on the '--no-headers' flag. |
| 23 |
+ #SHOWMOUNT="kshowmount --no-headers -e $key" |
| 24 |
+ #SHOWMOUNT="showmount -e $key | tail -n +2" |
| 25 |
+ |
| 26 |
+ for P in /bin /sbin /usr/bin /usr/sbin |
| 27 |
do |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
+ for M in showmount kshowmount |
| 34 |
+ do |
| 35 |
+ if [ -x $P/$M ] |
| 36 |
+ then |
| 37 |
+ SMNT=$P/$M |
| 38 |
+ break |
| 39 |
+ fi |
| 40 |
+ done |
| 41 |
done |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
+ [ -x $SMNT ] || exit 1 |
| 46 |
+ |
| 47 |
+ # Newer distributions get this right |
| 48 |
+ SHOWMOUNT="$SMNT --no-headers -e $key" |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
+ $SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \ |
| 53 |
+ awk -v key="$key" -v opts="$opts" -- ' |
| 54 |
+ BEGIN { ORS=""; first=1 } |
| 55 |
+ { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } |
| 56 |
+ END { if (!first) print "\n"; else exit 1 } |
| 57 |
+ ' | sed 's/#/\\#/g' |
| 58 |
+ opts="-fstype=nfs,hard,intr,nodev,nosuid" |
| 59 |
+else |
| 60 |
+ # NFSv4 |
| 61 |
+ opts="-fstype=nfs4,hard,intr,nodev,nosuid,async" |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
+ echo "$opts $key:/" |
| 70 |
+fi |