I am using OpenOffice 2.3 with Debian Lenny, and using a drive over NFS and OpenOffice seems to fail locking the file, so it “hangs” for a while and suddenly comes to life again but the file opened is only in read mode.

First I went to check my /etc/exports file and then to check if everything in the /etc/hosts.deny and /etc/hosts.allow files and all was correct, so after googling a while I found the solution.

You need to change the file:

/usr/bin/soffice

and make these lines look this way:

STAR_PROFILE_LOCKING_DISABLED=1
export STAR_PROFILE_LOCKING_DISABLED

#SAL_ENABLE_FILE_LOCKING=1
#export SAL_ENABLE_FILE_LOCKING
unset SAL_ENABLE_FILE_LOCKING

use your favorite file editor to edit that file and search for those strings, uncomment and comment or change accordingly.

thanks to this page