[Samba] Problems with file locking over gnome-vfs (esp. OpenOffice.org)

Lars Erik Kolden lars.erik.kolden at gmail.com
Thu Oct 16 08:05:45 GMT 2008


Hi.

First of all, I will probably post this question several places, at
least here, on the ubuntu forums, and perhaps OpenOffice forums. It is
a problem that I'm not sure if really is samba related, Openoffice
related or perhaps even OS related. As stated in the heading, it's
about file locking, so many apps come into play.

I work at a school where we teachers use mainly Ubuntu Hardy and
OpenOffice.org to edit files on samba shares on a Debian 4.0 box.
Samba version is 3.0.24-6etch10. There are also some users using
OpenOffice from XP, and some Mac users (both neooffice and OOo). The
ubuntu clients mounts the samba share thru gnome-vfs (that is, GNOME
desktop->places->connect to server->windows share).

The problem we have is that file locking between linux clients is not
working. Users will write to the same files in the same shares
simultaneously, causing data corruption and very angry users (yes, I
find myself in a very tight spot now, and probably should get myself a
copy of The Little Book of Calm).

On the other hand you have the XP users. If a document is opened in
Ubuntu, the XP user will open the file in read only mode. The other
way around, when opened first in XP, the OOo on the ubuntu client will
show a "general internet error" and close. Looks stupid, but is better
than data loss, so if this was the case between ubuntu clients as
well, I'd be very happy.

I have tried turning secure locking off in samba, also to turn oplocks
off (maybe they're the same?), but there's no difference. Also, I can
find no lck files on the samba server, if there should be any.

Does anyone have any solutions to this, or some troubleshooting tips?
There must be some way for samba to lock files, even if
OpenOffice.org's file locking scheme is flawed?

Also, I read somewhere that maybe mounting the shares with cifs could
work, but I'm not sure how to do that in gnome-vfs?

Thanks in advance for any help. Please tell if you need more info.

Oh, yeah. Here is my smb.conf:

[global]
        netbios name = odin
        server string = ""
        workgroup = vus-ansatte
        security = user
        wins support = yes
        encrypt passwords = true

        local master = yes
        os level = 255
        preferred master = yes

        hide dot files = yes
        invalid users = root,bin,sys
        strict locking = yes
        oplocks = yes

[homes]
        browseable = no
        read only = no


[test]
        guest ok = no
        read only = no
        path = /home/test
        create mask = 0660
        directory mask = 0770
        group = vusa


More information about the samba mailing list