To help this case going forward I ensured there is an easy repro for anyone to try.
The following works well on a clean Ubuntu (and most likely any) install.
$ sudo apt install smbclient samba
$ mkdir /tmp/testshare
$ sudo chmod 0777 /tmp/testshare/
$ cat << EOF | sudo tee -a /etc/samba/smb.conf
[testshare]
comment = Test bug 1893906
path = /tmp/testshare
browseable = yes
read only = no
create mask = 0700
directory mask = 0700
valid users = ubuntu
guest ok = yes
include = /etc/samba/test1.conf
include = /etc/samba/test2.conf
include = /etc/samba/test3.conf
include = /etc/samba/gtest1.conf
include = /etc/samba/gtest2.conf
include = /etc/samba/gtest3.conf
EOF
$ cat << EOF | sudo tee -a /etc/samba/test1.conf
comment = Test bug 1893906 - 1
include = /etc/samba/test1b.conf
EOF
$ cat << EOF | sudo tee -a /etc/samba/test1b.conf
comment = Test bug 1893906 - 1b
EOF
$ cat << EOF | sudo tee -a /etc/samba/test2.conf
comment = Test bug 1893906 - 2
EOF
$ cat << EOF | sudo tee -a /etc/samba/test3.conf
comment = Test bug 1893906 - 3
EOF
The overall structure we now created is like:
smb.conf
\- test1.conf
\- test1b.conf
\- test2.conf
\- test3.conf
To help this case going forward I ensured there is an easy repro for anyone to try.
The following works well on a clean Ubuntu (and most likely any) install.
$ sudo apt install smbclient samba test1.conf test2.conf test3.conf gtest1. conf gtest2. conf gtest3. conf test1.conf test1b. conf test1b. conf test2.conf test3.conf
$ mkdir /tmp/testshare
$ sudo chmod 0777 /tmp/testshare/
$ cat << EOF | sudo tee -a /etc/samba/smb.conf
[testshare]
comment = Test bug 1893906
path = /tmp/testshare
browseable = yes
read only = no
create mask = 0700
directory mask = 0700
valid users = ubuntu
guest ok = yes
include = /etc/samba/
include = /etc/samba/
include = /etc/samba/
include = /etc/samba/
include = /etc/samba/
include = /etc/samba/
EOF
$ cat << EOF | sudo tee -a /etc/samba/
comment = Test bug 1893906 - 1
include = /etc/samba/
EOF
$ cat << EOF | sudo tee -a /etc/samba/
comment = Test bug 1893906 - 1b
EOF
$ cat << EOF | sudo tee -a /etc/samba/
comment = Test bug 1893906 - 2
EOF
$ cat << EOF | sudo tee -a /etc/samba/
comment = Test bug 1893906 - 3
EOF
The overall structure we now created is like:
smb.conf
\- test1.conf
\- test1b.conf
\- test2.conf
\- test3.conf
$ sudo systemctl restart smbd
$ smbclient -L 127.0.0.1 -U ubuntu%ubuntu | grep testshare
testshare Disk Test bug 1893906 - 3
We see (and can experiment with) the comment that is just nicely set in each case.