Strange entries in my SMB config - should I be concerned?


CS01-HS

Recommended Posts

I noticed a couple of strange entries when I ran testparm -v 

 

The include for smb-unassigned.conf was added to my isos share (it's nowhere else in the output):

[isos]
case sensitive = Yes
comment = iso images
include = /etc/samba/smb-unassigned.conf
...

 

And similarly smb-shares.conf was added to my system share (which, in case it's relevant, is a cache-only share I export through /boot/config/smb-custom.conf to bypass shfs):

[system]
comment = system data
include = /etc/samba/smb-shares.conf
path = /mnt/active/system
...

 

Restarting smb and the server didn't change it so something's adding them.

Is that where they belong?

 

I run the UD and Recycle Bin plugins which I know make some modifications.

And for reference here's my SMB Extras:

[global]
   # Fix for 6.9.0-rc2 Mac client search
   spotlight backend = tracker
   # force inclusion of acl_xattr
   # (doesn't work because it doesn't propagate to shares)
   ##vfs objects = acl_xattr catia fruit streams_xattr
   # tweaks from https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X
   min protocol = SMB2
#Custom
include = /boot/config/smb-custom.conf

 

Link to comment
1 hour ago, CS01-HS said:

I run the UD and Recycle Bin plugins which I know make some modifications.

And for reference here's my SMB Extras

This is probably related to recyclebin. DLandon has already been tagged to confirm this so I won’t tag him again. Looking at your smb-extras.conf you may want to read this as well- https://forums.unraid.net/bug-reports/prereleases/macos-optimization-r2087/

It looks like you are adding settings for a Mac. There have been some changes in recent versions of unRAID regarding how smb settings are applied.

  • Thanks 1
Link to comment
20 minutes ago, CS01-HS said:

does something look off?

I would think that you would want to put spotlight settings in smb-fruit.conf. It may not matter but as I understand the new changes any settings applied from smb-extras.conf could get overwritten due to the order that settings are applied on array start. Any settings in smb-fruit.conf are applied last in the process.

DISCLAIMER- I’m not an smb expert so I may be wrong.

Link to comment

I did a quick test on a share with only a dozen files and no subdirs:

 

With my setup search returned the matching result instantly.

 

Then I added spotlight backend = noindex (the default) to smb-custom, restarted samba and searched again.

No results after 30 seconds.

 

So I want to say the fix is an improvement except when I removed the newly-added backend line from smb-custom and restarted, nothing changed - still no results. Maybe a proper test requires stopping and starting the array, which I can't do at the moment.

Link to comment

Add the following line to the [global] section of SMB Extras (which you can do via the GUI):

   spotlight backend = tracker

 

And the following line to /boot/config/smb-fruit.conf (which will add it to each share)

spotlight = yes

 

You can use this post as a reference but I wrote it before the advent of smb-fruit, so this new way is better.

  • Thanks 1
Link to comment
25 minutes ago, dlandon said:

Does the testparm -v show any errors?

 

Only WARNINGS before hitting enter but I think those were always there:

root@NAS:/boot/config# testparm -v
Load smb config files from /etc/samba/smb.conf
lpcfg_do_global_parameter: WARNING: The "null passwords" option is deprecated
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

 

Link to comment

What's gloing on here is a change I made to UD to put the share includes in the smb.conf file instead of the smb-extra.conf.  The idea was to get the settings out of the smb-extra.conf because of users making all kinds of changes now in the smb-extra.conf and the UD settings would be confusing.  When I added the include in the smb.conf file, it was added after the shares include entry.  Previously it was before the shares include because it was in smb-extra.conf.  This is what caused the "include =" statements to show in the shares with testparm.  It looks like testparm is actually including the [global] file includes in the share inappropriately.  If no errors or warnings are appearing in testparm regarding the include statements, it appears that it's just a display aberation in testparm.

 

That being said, I'm going to put the include for UD in the smb.conf before shares include and not after.  This will prevent the includes from showing in the shares in testparm.

 

Look for a UD update soon.

  • Thanks 1
Link to comment
6 hours ago, CS01-HS said:

Add the following line to the [global] section of SMB Extras (which you can do via the GUI):

   spotlight backend = tracker

 

And the following line to /boot/config/smb-fruit.conf (which will add it to each share)

spotlight = yes

 

You can use this post as a reference but I wrote it before the advent of smb-fruit, so this new way is better.

Thanks. Took a few hours to start working (not sure why) but working great now. Only a few seconds lag. 👍

  • Like 1
Link to comment
14 hours ago, dlandon said:

I'm going to put the include for UD in the smb.conf before shares include and not after.  This will prevent the includes from showing in the shares in testparm.

 

Installed and rebooted - mixed results:

 

The smb-shares include line is still present in the share:

[system]
case sensitive = Yes
comment = system data
include = /etc/samba/smb-shares.conf

 

The smb-unassigned include line is gone from the share but it's not present anywhere (according to testparm)

Should I add it manually to smb-extras and if so where?

 

[global]
   # Fix for 6.9.0-rc2 Mac client search
   spotlight backend = tracker
   # tweaks from https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X
   min protocol = SMB2
#Custom
include = /boot/config/smb-custom.conf
Edited by CS01-HS
I shouldn't post before coffee
Link to comment
10 hours ago, wgstarks said:

Took a few hours to start working

 

That's strange because I don't think spotlight indexing enters into it.

 

If I had to guess maybe some time within those few hours you disconnected/reconnected automatically or explicitly and that's what did it.

Either way, glad it worked.

Edited by CS01-HS
Link to comment
49 minutes ago, CS01-HS said:

The smb-shares include line is still present in the share:

This isn't the place to define a share.  As it is now, the "include = /etc/samba/smb-shares.conf" is being added to the [system] share because it is right after the smb-extra.conf include in smb.conf and the scope is still [system] when it returns to smb.conf and not [global].  The smb-extra.conf settings are global.

 

I don't know your disk and shares configuration, but set up a [system] share on your cache disk?  Hopefully your cache is not on the array.

 

50 minutes ago, CS01-HS said:

The smb-unassigned include line is gone from the share but it's not present anywhere (according to testparm)

Should I add it manually to smb-extras and if so where?

There is no need to add it manually.  The include is in smb.conf.  Again, don't depend on testparm to show the includes properly.

Link to comment
4 minutes ago, dlandon said:

Again, don't depend on testparm to show the includes properly.

 

Got it. Shame there's no simple way to confirm, makes me wonder about my own customizations.

 

5 minutes ago, dlandon said:

As it is now, the "include = /etc/samba/smb-shares.conf" is being added to the [system] share because it is right after the smb-extra.conf include in smb.conf and the scope is still [system] when it returns to smb.conf and not [global].

 

Huh, so is it better to put the smb-custom include at the top of smb-extras so scope is [global] when it returns? e.g.

#Custom
include = /boot/config/smb-custom.conf

[global]
   # Fix for 6.9.0-rc2 Mac client search
   spotlight backend = tracker
   # tweaks from https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X
   min protocol = SMB2

 

 

9 minutes ago, dlandon said:

a [system] share on your cache disk?  Hopefully your cache is not on the array.

 

I have a dedicated pool that serves docker, VM and scratch called active (single-disk, XFS), cache is separate.

Here's my full smb-custom.conf if you're curious:

Spoiler


[scratch]
	comment = scratch disk
	case sensitive = Yes
	path = /mnt/active/scratch
	spotlight = Yes
	valid users = me macos limited
	vfs objects = catia fruit streams_xattr extd_audit recycle
	write list = me macos limited
	recycle:exclude_dir = .Recycle.Bin
	recycle:exclude = *.tmp
	recycle:versions = Yes
	recycle:minsize = 1
	recycle:touch_mtime = No
	recycle:touch = Yes
	recycle:keeptree = Yes
	recycle:directory_mode = 0777
	recycle:repository = .Recycle.Bin
	fruit:zero_file_id = yes
	fruit:delete_empty_adfiles = yes
	fruit:wipe_intentionally_left_blank_rfork = yes
	fruit:veto_appledouble = no
	fruit:posix_rename = yes
	fruit:model = MacSamba
	fruit:encoding = native

[system]
	comment = system data
	case sensitive = Yes
	path = /mnt/active/system
	spotlight = Yes
	valid users = me macos
	vfs objects = catia fruit streams_xattr extd_audit recycle
	write list = me macos
	recycle:exclude_dir = .Recycle.Bin
	recycle:exclude = *.tmp
	recycle:versions = Yes
	recycle:minsize = 1
	recycle:touch_mtime = No
	recycle:touch = Yes
	recycle:keeptree = Yes
	recycle:directory_mode = 0777
	recycle:repository = .Recycle.Bin
	fruit:zero_file_id = yes
	fruit:delete_empty_adfiles = yes
	fruit:wipe_intentionally_left_blank_rfork = yes
	fruit:veto_appledouble = no
	fruit:posix_rename = yes
	fruit:model = MacSamba
	fruit:encoding = native

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.