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@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. ------------------------------------------------------------ -------------- next part -------------- HTML attachment scrubbed and removed
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@projtel.co.uk] Sent: Tuesday, April 17, 2001 10:01 AM To: samba@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@projtel.co.uk <mailto:simona@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. ------------------------------------------------------------
Also, the smbd daemon rereads the config file a regular intervals (60 I believe) so you don't have to do anything other than wait for the changes to take effect. Share's might not show up right away, however, because windows browsing caches the unholy hell out of everything, so it could be 30 minutes before the new shares show up. DO NOT restart samba while people are using it, however. This is a Very Bad Think (tm). Trust me, I've broken things doing it. Restarting smbd is a last ditch effort to correct a locked server. If you have a misbehaving client, kill that client's connection. -Bill ---------- From: MCCALL,DON (HP-USA,ex1) Sent: Tuesday, April 17, 2001 11:25 AM To: 'Simon Allenby'; samba@lists.samba.org Subject: RE: File locks when restarting smb 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@projtel.co.uk] Sent: Tuesday, April 17, 2001 10:01 AM To: samba@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@projtel.co.uk <mailto:simona@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. ------------------------------------------------------------ -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba