[Samba] Can I Include a directory to smb.conf?

Marc Muehlfeld mmuehlfeld at samba.org
Tue Nov 21 16:16:51 UTC 2017


Hello Özkan,

Am 21.11.2017 um 15:24 schrieb Özkan Göksu via samba:
> I want to include a directory to my smb.conf and i want to create each
> share under that directory.
> Can I do that?

Unfortunately not. The "include" parameter neither supports directory
paths nor wildcards.

It supports substitutions, but unfortunately, the %S (name of ths
current service, which would be the share name in your case), is
explicitely excluded. See the "include" parameter description in the
smb.conf man page.

However, you can of course add include statements for each new config
file you create.

As a workaround, you can write a short shell script that generates the
include statements, and run this script from your init-script/systemd
service before smbd|nmbd|winbindd|samba starts. However, this can delay
the start/reload if you have a lot of config files to process.

Regards,
Marc




More information about the samba mailing list