-2

I have since years an issue with Samba 4.3.11 and Windows 10 in a Domain with Samba Active Directory:

The Users on Windows 10 will be shown as further logged on on the samba server (smbstatus -b) even after a shutdown or restart of the Windows 10 clients.

If they do instead only a logoff they will correctly disappear from the smbstatus list after ~10 seconds.

I get a correct user logoff from the Samba server after Windows shutdown only if I limit the protocol on the samba server to NT1 (SMB1).

I'm building now a new domain with samba 4.13.13 and I see the same issue again.

I would very much like to come finally to a better solution than to still use the old smb protocol.

Thanks for any hint!

rawi
  • 97
  • 1
  • 4

2 Answers2

0

That is a feature of Windows. After a restart, it will logon the previous user and restart the applications that were running.

Greg Askew
  • 35,880
  • 5
  • 54
  • 82
  • Thank you Greg. I doubt this it is that particular Windows feature. It's not happening with SMB1 to the server, but with SMB3. And I deactivated already this sign-on feature for the users – rawi Dec 19 '22 at 18:35
  • @rawi: It should take about 10 minutes to connect to the computer and determine if there is a network connection, and the process that has the connection. – Greg Askew Dec 19 '22 at 18:49
  • on the server side I still see the pid of user's smbd about 1.5-2 hours after windows restart (may be until some timeout kicks in). On the client's (Windows 10) side I log on as Admin directly after restart and sure there is no active drive mapping to the server. I use Roaming Profiles and the clients are doing a real restart, no hibernation, no quick fake shutdown or restart. – rawi Dec 19 '22 at 19:00
0

Not yet a real solution here, but a hack to circumvent the problem:

  • socket options = TCP_NODELAY SO_KEEPALIVE TCP_KEEPIDLE=30 TCP_KEEPCNT=3 TCP_KEEPINTVL=3 - will terminate an inactive smbd after ~40 seconds - and
  • veto oplock files = /NTUSER.DAT/ntuser.dat/NTUSER.POL/ntuser.pol/NTUSER.INI/ntuser.ini/ - in the Home share declaration

The socket options are coming from this interesting thread: How to prevent samba from holding a file lock after a client disconnects?

The same idea emerged 2011 from a discussion of Samba gurus: https://lists.samba.org/archive/samba-technical/2011-July/078633.html

In the hope this will help to anyone searching for similar issues and answers and stumbling over this posting.

rawi
  • 97
  • 1
  • 4