RESOLVED - Cannot run testparm -s

Hello, I am trying to setup my HL15 to be a media storage unit, but am running into issues when I try to setup file sharing over SMB or NFS. I was following the directions in the manual and on page 48 it says you can run testparm -s. When I do that, I get this response:
Load smb config files from /etc/samba/smb.conf
“include = registry” only effective in global section
Error loading services.

I don’t know what this error means or how to resolve. and I couldn’t find another thread to help me. Any help would be nice. Thanks!

Hi @Joshua,
Is the samba service running?
try " sudo service smb status" at a command line.

HI @Joshua, could you share you /etc/samba/smb.conf file? i believe there is an issue there. looking at the output

The “include = registry” line is in the wrong location in the file

Where should it be? I thought I had to add it to File Share advanced setting but it would not let me.

This is what I got.

[sudo] password for 45drives:
Redirecting to /bin/systemctl status smb.service
● smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2024-02-15 14:40:18 AST; 1 weeks 6 days ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Main PID: 38393 (smbd)
Status: “smbd: ready to serve connections…”
Tasks: 3 (limit: 201672)
Memory: 11.1M
CGroup: /system.slice/smb.service
├─38393 /usr/sbin/smbd --foreground --no-process-group
├─38463 /usr/sbin/smbd --foreground --no-process-group
└─38464 /usr/sbin/smbd --foreground --no-process-group

Feb 26 17:09:27 hl15 smbd[242638]: [2024/02/26 17:09:27.937189, 0] …/…/source3/smbd/smb2_service.c:749(make_connection_snum)
Feb 26 17:09:27 hl15 smbd[242638]: make_connection_snum: canonicalize_connect_path failed for service REDACTED, path /REDACTED
Feb 26 17:09:27 hl15 smbd[242638]: [2024/02/26 17:09:27.943011, 0] …/…/source3/smbd/msdfs.c:146(parse_dfs_path_strict)
Feb 26 17:09:27 hl15 smbd[242638]: parse_dfs_path_strict: can’t parse hostname from path REDACTED

Samba is running, but it looks like your configuration file might be borked. Here is waht mine looks like.

Is there a way I can delete and restart? or fix this? Or am I able to match your settings?

Hi All,

@daemon1001, you can remove the include = /etc/cockpit/zfs/shares.conf from your config as you are using the filesharing tab and that would be if you were using the sharing model built directly into the ZFS tab which we do not use or recommend using

@Joshua, could you please send your /etc/samba/smb.conf file so I can instruct you on what needs to be changed to fix your SMB

1 Like

Hello Hutch,

I can send you the file. Is there an email you would like me to send it to?

@Joshua, You can simply match what @daemon1001 posted or post a picture of your smb.conf here.

This is what I got… I thought the service was running? or am I using the wrong command to get the config file?
Screenshot 2024-03-07 at 2.03.02 PM

Try using smb.conf, not .config

Sorry about that. This is what I have:

Hi @Joshua,
As Hutch said, we can remove the "include = /etc/cockpit/zfs/shares.conf if you are you using the file sharing tab. I had originally tried setting up file sharing through the zfs tab.
zfsInclude

Can you now run testparm -s?

@Joshua, As I mentioned above can you remove the “include = /etc/cockpit/zfs/shares.conf” liner from the file and restart SMB?

That option if only if you are using the built-in SMB share option on the ZFS tab which we do not recommend. We would recommend using the File-Sharing tb for managing SMB shares which would be the “include = registry” option

how do I remove “include = /etc/cockpit/zfs/shares.conf” and restart smb?

You can use vim or nano to edit it (either delete the line or put a ‘#’ sign at the start to make the line a comment.
‘sudo service smbd restart’ will get the service restarted.

1 Like

Gotcha, and where do I go to export this config file?

Hi @Joshua,
You don’t need to export this file anywhere. The operating system expects it to be where it is /etc/samba/smb.conf

Run this command ‘sudo nano /etc/samba/smb.conf’
Either comment the desired line by inserting a '#" at the beginning of the line or delete it altogether.
hit ‘ctrl + o’ (This will write out the changes to the file. that’s letter o not number 0)
then hit ‘ctrl + x’ (that will exit the command nano)

Then type ‘sudo service smbd restart’ which will force linux to read and update any changes you made smb.conf

Okay, so I have done this and it looked like it wrote it successfully, but when I ran service ‘sudo service smbd restart’ it failed. I then rand 'sudo service smb restart and it looked like it did something, but when I did ‘testparm -s’. I got a failed result (Pictures attached)