Problems configuring different options per NFS share for the same host, and/or exporting nullfs mount.

I have tried in multiple configurations, here is an list of attempts in comments
Code:
V4:  /nfs

# Works correctly, when in insolation, but in this configuration it does not work.
# Neither works when I mount a nullfs filesystem at /nfs/probe1, nor manually nor in the jail.conf
# The last situation does not gets better when adding V4: /nfs/probe1 192.168.0.25
/nfs/probe1 -mapall=root 192.168.0.25

# Works correctly, when in insolation. I have not tested all possible  cases, but suspect is the same as with /nfs/probe1
/nfs/probe2 -mapall=root -network 192.168.0.0 -mask 255.255.255.0

# Works correctly, when in insolation. I have not tested all possible cases, but suspect is the same as with /nfs/probe1
/nfs/probe3 -mapall=root

# Works correctly, when in insolation. I have not tested all possible  cases, but suspect is the same as with /nfs/probe1
/nfs/probe4 -mapall=root 192.168.0.201 192.168.0.226 192.168.0.25

# Tried the following combination, in isolation, the /nfs/probe6 did even show up on showmount -e.
V4: /nfs/probe5 192.168.0.25 192.168.0.201 192.168.0.226
/nfs/probe5 -mapall=root 192.168.0.25 192.168.0.201 192.168.0.226
V4: /nfs/probe6 192.168.0.25
/nfs/probe6 192.168.0.25

# Tried this in isolation, and does in fact work when alone, but is not very useful because cannot set different options for each filesystem
# to the same host.
/nfs/probe7 /nfs/probe8 -mapall=root 192.168.0.25
/nfs/probe8 -mapall=root 192.168.0.201 192.168.0.226

# For testing error messages:
#/nfs/probe15 10.10.10.10
#/nfs/probe1 -mapall=root -sec=krb5p
Here is my /etc/rc.conf
Code:
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
# dumpdev="NO"
nfs_server_enable="NO"
nfsv4_server_enable="YES"
mountd_flags="-r"
nfs_server_flags="-t -n 4"
And provision script:
Code:
#!/bin/sh
set -e

bsdinstall jail /jails/nfs

if [ -z "$(jls -Ns | grep name=nfs)" ]; then
        jail -crm -f etc/nfs.conf
fi;

cat > /jails/nfs/etc/rc.conf <<EOF
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
# dumpdev="NO"
EOF

sysrc -j nfs nfs_server_enable="NO"
sysrc -j nfs nfsv4_server_enable="YES"
sysrc -j nfs mountd_flags="-r"
sysrc -j nfs nfs_server_flags="-t -n 4"

cat exports | jexec nfs tee /etc/exports

service -j nfs rpcbind status || service -j nfs rpcbind onestart
service -j nfs nfsd status || service -j nfs nfsd onestart
service -j nfs mountd status || service -j nfs mountd onestart
 
Back
Top