Score:-2

Samba server showing user still logged on despite shutdown/restart of the Windows 10 client

ch flag

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!

Score:0
cn flag

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

rawi avatar
ch flag
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
cn flag
@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.
rawi avatar
ch flag
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.
Score:0
ch flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.