T
T
tictac172019-03-23 21:26:00
Apache HTTP Server
tictac17, 2019-03-23 21:26:00

Why don't file locks between Apache and Samba work?

I decided the other day to set up access to 1C Accounting through Samba for those who work in the office and through Apache for remote employees. The distribution kit chose Debian 9.8. That is, it turns out that the database is in file mode and web client mode at the same time. And that's what I came up with to check. I wrote a program that puts an exclusive lock on the 1C base file in the shared folder on Debian. Launched from Windows. I checked it from another Windows - it swears, it cannot open the locked file, and Apache on Debian, which accesses the database file directly, calmly opens and lets it into the database. That is, he does not see the lock at all. Nor does any other Linux process see it. What does this usually mean for a filebase? Of course, the collapse after a while, because the web client and the thick one will climb into the database inconsistently. Attention to the question: what to do, how to make linux (POSIX) processes see samba locks? Tested on default smbd.conf config except for oplocks - turned them off immediately. However, they do not change things. All tried parameters also did not bring results. Please, do not offer connection via a thin client to the same Apache.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rPman, 2019-03-23
@rPman

What database are you going to work with your files on http O_o? I strongly recommend that you think carefully and not do this, because you will create a headache for users.
https://www.oreilly.com/openbook/samba/book/ch05_0...

If you have a system that understands oplocks, set kernel oplocks = yes in the Samba configuration file. That should eliminate conflicts between Unix processes and Windows users.

D
Dmitry Kinash, 2019-03-23
@Dementor

It's strange to expect Windows lock to work under Linux. If you want to read only - set the appropriate access rights.

What does this usually mean for a filebase? Of course, the collapse after a while, because the web client and the thick one will climb into the database inconsistently.
That's bullshit. According to your logic, the fact that thousands of users work in modern DBMS at the same time is a myth, since multi-user access destroys any database.
Thick clients, thin clients or web clients through a web server that access the database using the wsap22.so library - all of them read and write data in the same way from the point of view of the 1Cv8.1CD file. If you have 2 users simultaneously working with the database through a thick client and this does not destroy it, then when a person enters through a web client (or a thin client, but through a web address), the situation will not change.
I published a filebase on the web back in the days of the 8.2.6 test (the client wanted to take a chance, since it was free for beta testers) - and there were no problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question