So file to modify on DSM 6.0 is /etc/rc.subr
And I modified /etc.defaults/rc.xpe for some error checking (interactive, not logging yet)
Code:
vol=/volume2
#init with failed
umount_ok=0
#umount volume
msg=$(umount $vol 2>&1)
rc=$?
rmsg=$!
if [ $rc -ne 0 ]
then
echo $rc
#check for "umount: /volume2: not mounted"
if [[ $rmsg == *"${vol}: not mounted"* ]]
then
umount_ok=1
else
echo "Error unmounting volume2 ($rc, $rmsg)"
fi
else
umount_ok=1
sleep 2
fi
mount -t nfs 192.168.125.32:/mnt/tank/media/audio /volume2
Unfortunately I can't share that mounted folder out yet due to the following error:
Will have to dig around a bit on that
Edit: This will not happen if I create a new share but then I can't share properly. Will need more investigation
Edit2:
Ok found it:
Basically I need to export one level higher, say
/mnt/tank/media (then i have video/audio subfolders on FreeNas)
On XPE I mount that to /volume 2 and then I create shares with the names of the to-be-shared subfolders audio and video.
I also joined XPE to my domain and provide access to the share to the same users as the original NFS share.
Might need to try that with smb next