As you said it is failing because of the nfs init script checking the number of lines in the exportfs and your /etc/export file empty, do the following
- navigate to /etc/rc.d/init.d/
- back up the nfs script (you can copy it to a different dir and rename it to nfs.bk)
find the following section in the script:
Do it the last so that clients can still access the server when the server is running.
cnt=
/usr/sbin/exportfs -v | /usr/bin/wc -l
if [ $cnt = 0 ]; then
action $"Shutting down NFS services: " /usr/sbin/exportfs -au
else
action $"Shutting down NFS services: " /bin/false
fi
The bold section indicate that the if statement check whether exportfs -v has more than 0 lines. If you run this yourself you will find out that it actually has 0 lines which cause the script to fail. So change [ $cnt -gt 0 ] to [ $cnt = 0 ] and everything will work.
Take extra precautions when changing system scripts. Make sure you back the nfs script first and test it by running the following:
service nfs stop
DO NOT REBOOT so it case something doesn't work you can always restore the original nfs scritp.