File locks when restarting smb

MCCALL,DON (HP-USA,ex1) don_mccall at hp.com
Tue Apr 17 15:25:55 GMT 2001


Hello Simon,
Samba is NOT going to preserve file locking information across a restart,
hence your problems.
Rather than restarting samba when you add a share, it should be sufficient
to issue the following command:
    killall -HUP smbd
to force all the smbd daemons to re-read the smb.conf file.
 
Hope this helps,
Don

-----Original Message-----
From: Simon Allenby [mailto:simona at projtel.co.uk]
Sent: Tuesday, April 17, 2001 10:01 AM
To: samba at lists.samba.org
Subject: File locks when restarting smb


Hi,
 
Is there a known problem with file locks when Samba restarts?
 
I have several servers happily running Samba on RH Linux, and several
hundred clients running M$ Win9x.
There are always a large number of open files, and I am currently migrating
the data off several NT servers and
onto the Samba ones. This has meant changing the smb.conf file on a regular
basis.
 
I am restarting Samba using "/etc/rc.d/rc5.d/K35smb restart"
 
If a user has a file open, with read-write permissions, and then Samba is
restarted, these permissions are lost.
The first Windows client still thinks it has RW permissions on the file,
however at this point a second user could open the same file, gaining the
permissions. The first user would then not be able to save the file
(correctly IMO) even though Word/Excel thinks it can. If the second user
changes the file, and saves and closes it, the lock is removed, and the
first user is free to overwrite the file again (losing the second user's
changes). Worse still, on several recent occasions, the file has corrupted
on the server, during saves after a Samba restart. This predominently
happens in Excel, although I believe it has happened in Word as well.
 
Should/could Samba save it's open locks, and re-read them under a restart (I
appreciate that this wouldn't be desired all of the time), or is there
another way of getting Samba to re-read the smb.conf and setting up new
shares without killing all of the active connections and therefore locks?
 
Your help is greatly appreciated.
 
Thanks in advance,
 
 
Simon
 
-------------------------------------------------------------
Simon Allenby - IT - Project Telecom plc
email - simona at projtel.co.uk <mailto:simona at projtel.co.uk> 
Direct line 01636 615200

------------------------------------------------------------
This communication is confidential and is intended
only for the person to whom it is addressed.
If you are not that person you are not permitted to
make use of the information and you are requested
to destroy the copy in your possession immediately.
------------------------------------------------------------






More information about the samba mailing list