SMB connection drops after ~half hour of no use

In CORE, I’m pretty sure my SMB shares stayed connected indefinitely. In SCALE, they seem to drop after about a half hour of inactivity. Is that likely due to an idle timeout setting? How could one change it?

I’ve gotten closer to fixing it; maybe someone can help me across the finish line. I found the SMB configuration file at \etc\smb4.conf .

I also found that the parameter I need to change is deadtime, The number of minutes of inactivity before the connection is ended (unless they have a file open). The config file has a bunch of parameters, but no deadtime entry.

I can edit /etc/smb4.conf and add deadtime = 720 (12 hours) in the [global] section, but the file is overwritten when I restart SMB.

There is a file of the same name at /usr/local/etc/smb4.conf . It has no parameters in it. I can’t add deadtime; I get a read-only filesystem error.

Help!

You can make a bug report and we’ll get it fixed for next release.

3 Likes

Bug report: TrueNAS - Issues - iXsystems TrueNAS Jira

Define “SMB drop”…

Errors?

Default deadtime is already 10080 minutes (1 week). FreeNAS ages ago had a different default (15 minutes) in FreeNAS 11.2.

We removed the deadtime parameter in 11.3 (switching back to 1-week default).

commit c809ca6f8ec0221aa2bf41af09fbc926734e7c94
Author: Andrew <awalker@ixsystems.com>
Date:   Mon Jan 6 16:04:25 2020 -0500

    Remove dead timer to improve stability of some non-Windows SMB clients

In this case it was in response to MacOS client bug whereby if you closed lid on MacOS laptop after it had mounted a share and if samba scavenged the session before you resumed MacOS client, the client would hang requiring reboot.

No error, just a popup saying “Server connection interrupted”. Any windows that were showing share content just revert to showing a Network window with any available connections.

Well, this is bizarre. After rebooting the server and opening a share on the client, the window was still open the next day. I’ve rebooted many times before but no such luck.

The only persistent change I made is creating a file /etc/samba/smb.conf with the contents

[global]
   deadtime = 720

Could that be getting read and effective?

No. It won’t be read or effective.