Solution to OpenOffice NFS locking problems

The problem

Linux versions of OpenOffice 2.0 and 2.2 (and possibly others) just fail to save files mounted over NFS. Examples:

Reason

Openoffice fails to lock files over NFS. It just fails without an error message or just hangs when saving files over NFS. (The proper behaviour would be making locking work over NFS (yes, it is possible, see O_EXCL in man 2 open in Linux), or displaying a warning, which could be disabled by the user.)

Workaround

Edit the file `type -p soffice` as root. Comment out all lines containing the word LOCKING (case sensitive), and add the following replacement there:

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