OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

OOo2--file locking under Samba?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> Setup and Troubleshooting
View previous topic :: View next topic  
Author Message
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Thu Mar 16, 2006 7:39 pm    Post subject: OOo2--file locking under Samba? Reply with quote

Hi--

We have just Monday moved our office away from Windows and into a Linux (Ubuntu 5.10) desktop, using OOo for our word processing and spreadsheets.

But we have discovered that two users can have open, edit and save the same document at the same time. This is quite dangerous!

I have tried several different settings in samba, all to no avail.

I have seen a couple of old threads here that prior versions of OOo had file locking turned off, but cannot find anything about ver 2.0.

Our file server is running Red Hat 9.0 and samba version 2.2.7a-security-rollup-fix.

Any suggestions?

Thank you.
_________________
:-Doug.
Back to top
View user's profile Send private message
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Mon Mar 20, 2006 5:52 pm    Post subject: Reply with quote

Hi--

Anybody have any ideas on this?

Thanks!
_________________
:-Doug.
Back to top
View user's profile Send private message
Zarius
OOo Enthusiast
OOo Enthusiast


Joined: 21 Jan 2005
Posts: 142
Location: Brisbane, Australia

PostPosted: Mon Mar 20, 2006 11:21 pm    Post subject: Reply with quote

Howdy,

I've got a similar issue, got filelocking working nicely with OOo2 under Linux only, until our one Windows box comes to play (documents located on the Linux server). Opening a linux based document on a Linux client, then on Windows, results in a general i/o error which is good - but opening on the Windows box first doesn't lock the file at all - which is bad.

The only way I worked around this was to write my own filelocking code, not as elegant (though it does tell you who has the file open, but you get false positives if docs aren't closed properly) so other solutions would be welcome.
_________________
Zarius Tularial. (WinXP - OOo 1.1.4, FedoraCore 4 - OOo 2.0, RHEL4 - StarOffice 7)
Quoots - a quicker way to open your documents and fill in template details in OOo. (written in OOBasic)
Back to top
View user's profile Send private message Visit poster's website
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Tue Mar 21, 2006 8:56 am    Post subject: Reply with quote

Zarius--

Would you be willing to share your code?

One thought I had was to have the linux boxes access via NFS and Windows via samba, but don't know what that will produce....
_________________
:-Doug.
Back to top
View user's profile Send private message
naxfen
General User
General User


Joined: 21 Mar 2006
Posts: 7

PostPosted: Tue Mar 21, 2006 9:24 am    Post subject: Reply with quote

Hi dgermann, Zarius & the others that might help,

It's actually my first post on these forums (even if I've been using OOo for a few years now), so bear with me Smile

We've decided to try OOo at work, 3 computers (for now): 1 Mac (X 10.3.9), 1 Windows (XP Prof) & 1 Linux (Fedora Core 3). I know, not the best hybrid situation... Shocked

Oh, and it's OOo 2.0 on all machines (even the Mac, with X11).

Wait, it gets worst Wink : For now, the files are shared on the Windows machine, and the Mac and Linux boxes connect throught Samba.

As you can guess, I'm having some serious problems with file locking.

First, I had to edit soffice on the Mac so that it could actually read/write through samba : http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=1947&highlight=file+locking

But now, of course, we're talking about serious file rewriting/corrupting/etc problems.

Ideally, we would use a Linux box as fileserver, and if needed with subversion, but I'd prefer if I could avoid teaching to my coworkers (office workers, non-programmers) how to use a versionning system that complicated (even more since OOo has it's own versionning system), and we have to keep the shared files on the windows box (for now).

Any help or suggestions would be much appreciated!
Back to top
View user's profile Send private message
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Wed Mar 22, 2006 6:28 pm    Post subject: Reply with quote

Any progress folks?

I posted this on the users mailing list (you can look at it here: http://news.gmane.org/gmane.comp.openoffice.questions ) about 3 days ago, but have gotten no reply there either.

Ought to be some sort of an answer.

We only have a few files that we might be bumping into each other, so I wonder if there might be some way to quarantine these files while we are in them? Move them when we are in them? Set them up for backups every two minutes?
_________________
:-Doug.
Back to top
View user's profile Send private message
Zarius
OOo Enthusiast
OOo Enthusiast


Joined: 21 Jan 2005
Posts: 142
Location: Brisbane, Australia

PostPosted: Wed Mar 22, 2006 6:31 pm    Post subject: Reply with quote

Hi,

I've opensourced the code under GPL, it's currently embedded as part of my Quoots project. There are some limitations though:

* it currently only provides file-locking for documents opened through the Quoots "quickload" window.

* it could still warn the user for normal opening, however the document would still open, as I can't abort a standard open document process - see this thread (second post) for more details. Still searching for a solution, but none yet.

* the file-locks stay in place if Openoffice crashes, giving false locked readings - generally not a big problem though, simply reopen and close the file properly (or delete the filelock manually).

I haven't released a file packed on sourceforge yet, however the sourcecode is available if you know how to use CVS. I have also released a temporary version at this location until I get the proper file package up. I've made quite a few changes recently, and will be posting a new version shortly.

If you need any help installing, or perhaps isolating the file locking code (most of it's in the QuickLoad/FileLocks module), just let me know.

PS: quoots installation for OO2 is still a bit rough (due to changes in the database and keyboard shortcut locations), if you have OO1 or Staroffice around, easier to test it on that - I'm working on making the OO2 installation fully automatic.

Regards,
Z.
_________________
Zarius Tularial. (WinXP - OOo 1.1.4, FedoraCore 4 - OOo 2.0, RHEL4 - StarOffice 7)
Quoots - a quicker way to open your documents and fill in template details in OOo. (written in OOBasic)
Back to top
View user's profile Send private message Visit poster's website
naxfen
General User
General User


Joined: 21 Mar 2006
Posts: 7

PostPosted: Thu Mar 23, 2006 8:44 am    Post subject: Reply with quote

Hola Zarius,

Thanks for the heads up. I'm not at the office right now, so I'll have to wait before testing... In the meantime, the link http://jasonq.eml.cc/quoots.zip doesn't seem to work (as of writing, it's a 500 Internal Server Error). But anyway, I checked it out through CVS.

When you say:
Zarius wrote:
quoots installation for OO2 is still a bit rough (due to changes in the database and keyboard shortcut locations)

Do you mean that it's impossible? Or could you offer some indications of what will have to be done (we're on OOo2.0.2 at the office, on the 3 systems).
Also, did you have any experience with OOo/Quoots on Mac?

Just doing my pre-lab homework Wink . Anyway, I'll do some tests tomorrow at the office, and keep you updated.

Thanks again!
Back to top
View user's profile Send private message
Zarius
OOo Enthusiast
OOo Enthusiast


Joined: 21 Jan 2005
Posts: 142
Location: Brisbane, Australia

PostPosted: Thu Mar 23, 2006 8:35 pm    Post subject: Reply with quote

Howdy again,

Apologies, the link worked, but something went awry with the webserver. I've reuploaded the file and it seems to work ok now.

Installation under OO2 works, pretty much the only manual part now is setting up the new ".odb" database files. I have detailed this in the readme.txt and have also included a draft manual, so I'd recommend this file over the CVS (also, the CVS version's file locking may not even work with OO2, it's a little old).

I don't have any experience with Mac's, but most of it should work ok on a Mac (might need a little adjustment). However, it would help if you could provide me with the "GuiType" for Mac's - I have included a sample macro in the new Quoots version, when installed press F5, then "mo" and enter.

Let me know the GuiType result in a PM, so we don't hijack this thread away from the main issue of file locking between OS'es Smile

Regards,
Z.
_________________
Zarius Tularial. (WinXP - OOo 1.1.4, FedoraCore 4 - OOo 2.0, RHEL4 - StarOffice 7)
Quoots - a quicker way to open your documents and fill in template details in OOo. (written in OOBasic)
Back to top
View user's profile Send private message Visit poster's website
naxfen
General User
General User


Joined: 21 Mar 2006
Posts: 7

PostPosted: Fri Mar 24, 2006 10:26 am    Post subject: Reply with quote

Hola Zarius,

I've yet to install quoots on the Mac...

I installed it on my Linux box (Fedora Core 3 Legacy), without any trouble (didn't need to setup the shortcut keys or connect to the dbs, just the onClose event Shocked ).

But I'm experiencing a serious problem with the Win box (Windows XP Prof.):
While installing (after clicking on Install > Yes > As Top Menu 'Quoots'), I get this error:
Code:

BASIC runtime error.
An exception occurred
Type: com.sun.star.ucb.InteractiveAugmentedIOException
Message: a general error during transfer command.

And the cursor behind is at the 131st line of install_quoots.Standar:
Code:

fileAccess.copy(sourcePath + fileNames(i), sofficeConfigPath + oo2FileNames(i))

I got this error twice on the admin account, but then it installed OK (I still had to configure the onClose event, of course). But I just doesn't want to work on a non-admin account (and I need to make it work, it's this account that really counts Confused ).

Any suggestions?
Back to top
View user's profile Send private message
Zarius
OOo Enthusiast
OOo Enthusiast


Joined: 21 Jan 2005
Posts: 142
Location: Brisbane, Australia

PostPosted: Fri Mar 24, 2006 7:02 pm    Post subject: Reply with quote

Hmm, that's weird, because that codes just copying some files from the quoots installation directory to the users OpenOffice directory, of which they should have write access.

This can be worked around, but I'd like to fix it, I've sent you a PM with some more detailed instructions if you want to test it for me.
_________________
Zarius Tularial. (WinXP - OOo 1.1.4, FedoraCore 4 - OOo 2.0, RHEL4 - StarOffice 7)
Quoots - a quicker way to open your documents and fill in template details in OOo. (written in OOBasic)
Back to top
View user's profile Send private message Visit poster's website
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Sat Mar 25, 2006 10:40 am    Post subject: Reply with quote

Hi folks--

Just an update on what I have found.

Over on the users listserv I got this answer:
Quote:

There is a shell variable called something like SAL_LOCK which may be
interesting to turn on. Have a look on http://wiki.services.openoffice.org as
I think those variables are listed somewhere there.

Also the latest release of OpenOffice.org, 2.0.2, may also solve the problem.


To which I replied today:
Quote:

CPHennesey--

Thanks for your reply. It was helpful in narrowing things down a bit.

At the site you mentioned, I found the environment variable and did on two linux boxes--
export SAL_ENABLE_FILE_LOCKING=1

Then I opened a testlock file in OOo Writer. However, I was able to have it open on both computers and edit in both at the same time.

I also tried STAR instead of SAL in the export command and got the same results.

Found no other SAL variable on that site that seemed to fit what you suggested. Did I get the one you had in mind?

Did some further testing and found that I could gedit a file at the same time on both computers, too. Trying to vi the same file on both produced an error in vi, either at the opening of the file or at the saving. But KWord could have a file open and edit it when it was open in gedit. This suggests to me that it is not wholly an OOo issue, although OOo might have an internal solution.

Any ideas where to turn next?

Thanks for your help!

:- Doug.


Does this suggest anything that might be hopeful?

Thanks for your working to an answer for us all.
_________________
:-Doug.
Back to top
View user's profile Send private message
Zarius
OOo Enthusiast
OOo Enthusiast


Joined: 21 Jan 2005
Posts: 142
Location: Brisbane, Australia

PostPosted: Sat Mar 25, 2006 11:43 pm    Post subject: Reply with quote

Hmm, I believe there is a SAL_ENABLE_FILE_LOCKING in the soffice script under Linux (can't check it at the moment though) - how are you starting OpenOffice? "soffice" or "soffice.bin"? If you haven't already tried the "soffice" script (<OpenOffice/program> directory) give it a go, but I don't know if it'll solve the locking over samba problem.
_________________
Zarius Tularial. (WinXP - OOo 1.1.4, FedoraCore 4 - OOo 2.0, RHEL4 - StarOffice 7)
Quoots - a quicker way to open your documents and fill in template details in OOo. (written in OOBasic)
Back to top
View user's profile Send private message Visit poster's website
dgermann
OOo Advocate
OOo Advocate


Joined: 17 Mar 2003
Posts: 215

PostPosted: Sun Mar 26, 2006 6:30 pm    Post subject: Reply with quote

Zarius--

Thanks for the quick reply.

I am starting OOo in gnome from the menus, so I do not know exactly what command it uses (or how to check).

But I have seen things that say that the default is now for file locking, which was not the case in a prior version of OOo. So that might not be the trail we need to follow.

Someone else is suggesting this as a solution, which I have yet to check out: http://marc.theaimsgroup.com/?l=isn&m=105644749525437&w=2
_________________
:-Doug.
Back to top
View user's profile Send private message
naxfen
General User
General User


Joined: 21 Mar 2006
Posts: 7

PostPosted: Mon Mar 27, 2006 7:41 am    Post subject: Reply with quote

Hello all,

Sorry for the delay, but I was away from the office this weekend (strange, heh?)

Personally, I'll try to stick to quoots for now, mostly since I'm stuck with Win XP as our file server.

In fact, therein lies my last problem:
Zarius:
Since I'm stuck on Windows as our file server, the directory shared is
Code:
C:\Documents and Settings\All Users\Documents\

And that's the path I've put in quoots_personal/Tables/config/documentpath (on the File server, that will also be used to do some "office" work)
And for the filelockpath, I've put:
Code:
C:\Documents and Settings\All Users\Documents\quoots\file_locks\

But whenever I open a new file (and a filelock is created), the following directories are created:
Code:
C:\Documents__and__Settings\All__Users\Documents\quoots\file_locks\

And since these directories aren't shared throught the network, the file locking doesn't work when someone from another computer (Mac, Linux) tries to open the file...

By the way, I also tried:
Code:
file://C:/Documents%20and%20Settings/All%20Users/Documents/[quoots/file_locks/]

Without any effect (so I guess that it's the BASIC code which changes the " " in "__" for the filelocks path?)

Any help would be much appreciated!

P.S.: I wasn't able to reproduce the BASIC error reported earlier, so I guess I was trying to run the installation process from a directory where I didn't have the write permission!
P.P.S.: I'm a bit worried: will I be able to put files in subdirectories in quickload_files, and will it still be understood by the different OS?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> Setup and Troubleshooting All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group