I’ve some Ubuntu Servers operating Samba with Winbind. Every thing is okay, however Macs will randomly disconnect in a single day, or at some irregular interval.
On the servers, Samba logs this as two occasions:
1: ../source3/smbd/service.c:1050(close_cnum)
2: closed connection to service information
By matching timestamps on the Macs I can see they log the drops as:
kcm DEPRECATED USE in libdispatch consumer: Setting timer interval to 0 requests a 1ns timer, did you imply FOREVER (a one-shot timer)?; set a breakpoint on _dispatch_bug_deprecated to debug
By analyzing timestamps I’ve decided that that is the one occasion logged on the Mac shoppers’ facet. Right here is an instance consumer that has a shell script writing to a textual content file on a share each ten seconds:
You may see the connection was alive at 08:59:46
within the textual content file on the left, and in /var/log/system.log
there’s solely a single related message.
I requested on the Samba record serve about it and have been advised the Macs are merely closing the connections.
Replace:
Wireshark evaluation reveals some further data:
- STATUS_NETWORK_SESSION_EXPIRED
- SATATUS_INVALID_PARAMETER
- STATUS_NETWORK_NAME_DELETED
Right here is the ultimate SMB2
message (second from backside): Negotiate Protocol Response
:
As if to confound, there’s an NT Standing: STATUS_SUCCESS
messages in there (see annotation).
Here’s what Microsoft says concerning the error:
If the Standing discipline within the SMB2 header is
STATUS_NETWORK_SESSION_EXPIRED, the consumer MUST try and
reauthenticate the session that’s recognized by the SessionId within the
SMB2 header, as laid out in part 3.2.4.2.3. If the
reauthentication try succeeds, the consumer MUST retry the request
that failed with STATUS_NETWORK_SESSION_EXPIRED. If the
reauthentication try fails, the consumer MUST fail the operation and
terminate the session, as laid out in part 3.2.4.23.
Is there a script I can run to simply renew the session in a cron job?
Finish replace
Different varieties shoppers will preserve the connections open ceaselessly, so it does certainly appear to be solely Macs are doing this. The OS variations range from OS X 10.12 to macOS Catalina, utilizing varied flavors of SMB2 to SMB3.
Any concept how I can start to know why the macs are doing this, or any tips about getting them to maintain the connections alive?
The Mac shoppers are operating jobs that depend on a persistent connection.
Extremely related to know, however initially not noted as I used to be searching for a workaround:
I’ve a couple of dozen of those servers (largely Ubuntu 18.04; Samba 4.7.6) operating positive for the previous a number of years. Three of them had computerized updates put in, and these three have the difficulty of the Macs disconnecting. I am holding again letting the opposite servers restart for the updates, and the Macs is not going to drop connections to the non-updated servers.
As a take a look at I setup a server to 16.04 to see if and older model of Ubuntu Server would pose the identical concern. Surprisingly it has the identical downside utilizing a distinct model of Samba (4.3.11). I must do the take a look at once more, with out letting 16.04 set up the most recent safety updates, with a purpose to affirm my suspicions that these are the reason for the issue.
Although I think one thing in Ubuntu’s core modified, I’m asking right here since solely Macs are affected.
On quite a lot of Macs with OSes from 10.12 to Catalina I’ve tried testing them with their default settings, and all attainable mixtures of adjustments to /and many others/nsmb.conf
:
[default]
signing_required=no
protocol_vers_map=[see manpage for nsmb.conf (linked below)]
I’ve additionally tried disabling all sleep and powersaving choices, and even utilizing a pleasant cafffinate
wrapper, KeepingYouAwake, to implement this.
On the server I’ve tried following the recommendation of one other sysadmin on the #macosx freenode channel, kode54, who shared how they finally acquired a steady connection.
The recommendation did not assist–nicely I have not absolutely tried it because it requires putting in a model of Samba from a PPA for a model of Samba maintained by the Linux for Faculties Venture–however knowledgeable me of vfs_fruit
and the very fact that there’s a developmental effort of extending Samba by an additional bundle for, partially, coping with Macs. It additionally led me to discover a web page on Samba’s wiki discussing difficulties with Macs and server-side workarounds: Configure Samba to Work Higher with Mac OS X
It is troublesome for me to strive putting in recommended Samba PPA as a result of these servers are fileservers partially solely, and are typically at all times getting used for compute jobs that may take days to run (neuroimaging processing). They had been constructed for compute jobs, and do storage virtually as a side-effect of the dual-socket, high-memory density, server choices additionally taking place to be the servers with the massive variety of drive bays (16+).
I am hoping to strive different choices earlier than changing into absolutely negatively disruptive.
Since not one of the server-side choices are serving to–I have been making an attempt the flags in varied mixtures no to avail–I’m hoping that the Apple neighborhood may have some workaround for me.
Any method of conserving a persistent connection, regardless of the place the difficulty might originate, can be extremely worthwhile.