43.10. Editing Other File Share Options

There are a few more file share options related to locking and automatically running commands that you can set using this module as well. Those are used for locking control of the behavior of Samba when a Windows client tries to lock a file to gain exclusive access, so that it can cache data in the file without having to contact the server for every read or write. By default, locking is fully enabled and implemented in exactly the same way as it is on Windows servers, so there is generally no need to change these settings.

Samba can also be configured to run shell commands when a client connects or disconnects, either as root or as the connecting UNIX user. This can be useful if you want to move newly added files to some other directory or perform some kind of processing on them.

To edit the module's other file sharing options, follow these steps:

1.
Click on the name of the share to edit on the main page, and then click on the Miscellaneous Options icon on the share editing page that appears.

2.
If this share is exclusively for read-only use (for example, if you are sharing some kind of read-only media like a CD), then the Fake oplocks? field can be safely changed to Yes to boost performance. This tells Samba to simply grant all lock requests by clients and not to bother actually keeping track of who has locked what, which can boost performance.

None of the other locking fields should be touched unless you really know what you are doing, as the defaults will work fine and any other settings may lead to data corruption if multiple clients try to access the same files.

3.
To limit the number of clients that can be connected to this share at any one time, select the second radio button in the Max connections field and enter a number into the adjacent text box. This can be useful if you want to limit the load on your system. If Unlimited is selected, no maximum will be placed on the number of concurrent connections.

4.
The fields Command to run on connect and Command to run on disconnect allow you to enter shell commands that will be run by Samba as the authenticated user at connection and disconnection time. They will always be run in the share directory, and special % codes like %U for the connecting user or %S for the server name can be used in the command.

5.
Similarly, the Command to run on connect as root and Command to run on disconnect as root fields can be used to enter shell commands that will always be run as the UNIX root user. They will, however, be run in root's home directory instead.

6.
Hit the Save button to activate the new locking and command settings.

One thing to remember about locking and Samba is that locks taken out by SMB clients will not generally effect or be detectable by UNIX programs or NFS clients. This means that data corruption can still happen if UNIX and Windows programs open the same file, or if the same NFS exported directory is shared by two different Samba servers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.157.12