Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I am hoping this rings a bell with someone and there is an easy solution. I am running samba on RHE 5 and have a strange file locking problem. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    20

    wierd file locking issue with samba


    Hi,

    I am hoping this rings a bell with someone and there is an easy solution.

    I am running samba on RHE 5 and have a strange file locking problem. I am running a BDE database app and every time two users try and open the program they get an error that says the paradox.lck file is already in use access denied.

    I have turn oplocks off on both the server and individual client machines and this still happens. The weird thing is that if two users are logged on with the same user name then the program works fine. This locking issue shows up for other files as well.

    In other words if we have two computers logged on to samba as the same user (ie "staff") every thing is fine for those two computers. However if you attempt to access the database from the user "Staff" and "joeUser" then you get the error.

    I don't have my smb.conf file here and will post it later. I was just curious if this rings a bell with anyone.

    The other thing is I have samba set up as a domain controller but was having so many issues getting machine accounts working I gave up and am using it by just connecting to the shares from a workgroup and just mapping to them on the clients.

    This was sort of a pilot for me to get some of my networks off microsoft and I don't have a great deal of experience with Linux. So far its not been going so well. Any help is a appreciated.

    Thanks.

  2. #2
    Just Joined!
    Join Date
    Sep 2006
    Posts
    12
    On Samba there is a load of documentation on the system, look in:
    /usr/share/doc/samba
    /usr/share/doc/samba-common
    /usr/share/doc/samba-doc
    Your problem seems a databaseproblem, the file paradax.lck locks the database instead of only records, you should look into that.

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    20

    Its not a database problem

    This was a straight copy from another system. It isn't a database problem and i've been through the documentation.

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,746
    You have 2 users trying to open/access/create the same .LCK file it sounds like. Either they are trying to create the same file (which is denied for one) or one of the accounts doesn't have permission to open/create.

    You may want to use lsof to find out what files are open and where they are conflicting.

    It isn't a database problem...
    This is not the way to think about this problem. This *COULD* be a part of the DB design that worked on Windows and won't work on Linux. Linux is not Windows and I would not assume that because I copied some files over to a Samba share I am going to see the same behavior from my DB app that uses those files. Getting file permissions set up the way you need them is usually a little more in-depth on *Nix machines.

    GL.

  5. #5
    Just Joined!
    Join Date
    Sep 2006
    Posts
    12
    As the locked file shows this is Paradox.
    Now if you use paradox multiuser you must own a server-version that is what I ment, "it looks like a database problem".
    If you let 2 users log in with the same name and work on the same database that is like playing russian roulette with the integrity of your database, your lucky it is still working.
    Check wether your version of paradox is suited for functioning on a server, if not upgrade or convert to another real multiuser database.

  6. #6
    Just Joined!
    Join Date
    Aug 2006
    Posts
    20

    paradox

    Ok. First I've worked with paradox, the bde and delphi since version 1.0 of each product.

    1. The bde creates a paradox.lck and a users.lck in each directory where .db files are opened. This manages the record locking for each table. In order for this to work every user must use the same .cfg file (idapi32.cfg usually) that is on a common share. When there is a locking conflict the bde will raise an exception that says there is a locking conflict. If clients are using different config files paradox will raise an exception saying that the .lck file is in use by a different .net directory or something close to that.

    2. The bde doesn't care what user you are logged in as it keeps its own internal client tracking (this is why all clients need the same config file with the same .net directory defined). I have at least 10 bde application running on networks that use common logons. T

    3. This entire application was copied from a previous server with no changes. If I log the same clients on the old server it works. The only thing with new date stamps are the .lck files which are created by the first bde application that opens the database file. This test was done by simply doing a net use g: /d and then doing a net use g: \\oldservername\sharename. (g: is their network share drive letter).

    I don't know what this is but it isn't the bde.

    <
    This is not the way to think about this problem. This *COULD* be a part of the DB design that worked on Windows and won't work on Linux. Linux is not Windows and I would not assume that because I copied some files over to a Samba share I am going to see the same behavior from my DB app that uses those files. Getting file permissions set up the way you need them is usually a little more in-depth on *Nix machines.>

    Well thats pretty scary because I went out on a limb to get these guys to go Linux/samba. All the users belong to the group gjdemp and that group is the primary group. All files that are created by users end up with user name as the owner and gjdemp as the group. The directory I am talking about has permissions of 770.

    I am going to try this with ms access .mdb files and see if I have the same issue.

    Thank you for the replys.

  7. #7
    Just Joined!
    Join Date
    Aug 2006
    Posts
    20

    solution

    I just wanted to post the solution to this issue. Apparently I did not map the samba and linux groups.

    Apparently when this happens files are still created with the users primary group and even though other users are in that group it doesn't work right until you do the mapping. (google "net groupmap" for the nitty gritty details)

    The first clue to this issue was when I put a force user = <ausername> in the smb.conf and all the locking problems went away.

    The database was happy and did not cause file corruption though obviously mapping the groups is the way it should be done.

    I guess I should have RTFM better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •