Koozali.org: home of the SME Server

5.5 preventing file locking

Andy Parkinson

5.5 preventing file locking
« on: July 10, 2002, 02:22:44 PM »
One of my customers previously had a netware network and we persuaded them to go to SME (actually it was easier as they had lost some of their disks and the system had crashed). The problem now is that the database software will not work correctly under SME. It will only work with one user at a time.
The software is just a fairly simple Dos based system that users a file to record who is writing to what and thus does not need the operating system to lock files. Under Netware they used the Flag command to make certain files shareable. This had the effect of making them available for all users to have read write access to them even when another user had the files open. What I think I need to do is to set up Samba to not be strict about file locking on just that I-bay but I am not sure how to go about this. If anyone has any ideas I would be most grateful. The client by the way is happier with SME as it runs faster than their old Netware server.

John Crisp

Re: 5.5 preventing file locking
« Reply #1 on: July 10, 2002, 05:45:58 PM »
Don't know whether it's relevant but I had some problems with locking as well - see my posts :

http://forums.contribs.org/index.php?topic=13920.msg52921#msg52921

I eventually hacked smb.conf and set up oplocks=yes on one particular i-bay which cured it. I only use this i-bay for the one particular application.

Have a good hunt throught the forums and read the Samab dox - you may get some clues there too.


HTH

B. Rgds
John

Andy Parkinson

Re: 5.5 preventing file locking
« Reply #2 on: July 10, 2002, 10:14:57 PM »
Thanks John. I have tried putting the line share modes = no in the smb.conf in the section relating to that i-bay and now I am able to make the database perform as it should do.What I need to know now is how to create a template so that it doesn't keep overwriting it. Any help would be appreciated.

John Crisp

Re: 5.5 preventing file locking
« Reply #3 on: July 11, 2002, 04:05:14 AM »
Andy, if you can bear with me, I'll be going to play with the server that I configured this way. I'll have a look in the templates and show you what I did.

Don't ask me why this works though - I have NO idea ! I just had a good read round, built a test bench box, and experimented. I decided that I'd just run it on one i-bay so as not to mess up the rest of the box as everything else worked fine as it was.

I'll try and post tomorrow night.

B. Rgds

John

Derek

Re: 5.5 preventing file locking
« Reply #4 on: July 11, 2002, 07:56:27 PM »
Follow these instructions to make a custom template to get your smb.conf changes to stick. The fragment that you're probably going to want to template is 90ibays

http://www.e-smith.org/custom/

John Crisp

Re: 5.5 preventing file locking
« Reply #5 on: July 12, 2002, 05:24:45 PM »
Andy,

I didn't get there in the end I'm afraid.

I was just looking at my test bench machine here and trying to remebmer what I did.

I hacked the 90ibays file directly rather than rather than trying to create a fragment.

MAKE A COPY FIRST !!!!!!

My standard file here is as follows. After the 'printable' line I put in something similar to the following :

if ($key eq 'name of your ibay that you want to change oplocks on')
{
$result .= "oplocks = true\n";
}

Then run :

/sbin/e-smith/expand-template /etc/smb.cnf

and check to see if it's OK.

Just tried it and it works here ! Good luck.

B. Rgds
John


File: 90ibays           Col 0              1952 bytes                                                    0%
{
    # process all information-bay directories

    my %accounts;
    tie %accounts, 'esmith::config', '/home/e-smith/accounts';

    my $key;
    my $value;
    my $result = "";

    while (($key,$value) = each %accounts)
    {
        my ($type, %properties) = split (/\|/, $value, -1);
        if ($type eq 'ibay')
        {
            $result .= "\n";
            $result .= "[$key]\n";
            $result .= "comment = $properties{'Name'}\n";

            #---------------------------------------
            # If no public access, have the share go directly to the files
            # subdirectory (for easier drive mappings)
            # Otherwise, have the share mapping show all three subfolders
            #---------------------------------------

            if ($properties{'PublicAccess'} eq 'none')
            {
                $result .= "path = /home/e-smith/files/ibays/$key/files\n";
            }
            else
            {
                $result .= "path = /home/e-smith/files/ibays/$key\n";
            }

            $result .= "read only = no\n";
            $result .= "writable = yes\n";
            $result .= "printable = no\n";

******somewhere here**************


            # Make the defaults really stupid
            my $fmode = "0000";

            if ($properties{'UserAccess'})
            {