[Samba] Include directory in smb.conf
santiago.diez at caoba.fr
Fri Feb 10 04:32:04 MST 2012
Thanks Nicol and Moray for your participation.
Yes Nicol, I do have a particular need :
I find it very usefull to be able to manage atomic configuration options
adding or removing files rather than editing lines inside files.
I use */etc/cron.d/*, */etc/sudoers.d/*, */etc/init.d/*, *
/etc/apache/sites-enabled/* very often!
Take *cron*, if I want to activate a job that setup time, I need to include
this line in /etc/crontab
0 0 * * * root ntpdate my_ntp_server
But maybe I have multiple lines, maybe I want to do that automaticaly on
If so, I'll need to setup a very techy sed command to make sure the cron
doesn't exist already, etc...
With cron.d, I only have to run
echo "0 0 * * * root ntpdate my_ntp_server" > /etc/cron.d/ntpdate
If it doesn't exist, it is created, if it exist, it is updated with new
Take *samba*, I manage multiple servers for many very small charity
organization or independent workers.
I'd be very happy to have 1 unique configuration file for all servers and
then atomic share config files in a directory network dependant.
Same thing that for cron, I don't want complex sed commands.
I want to echo the configuration for *one share* into *one file*.
If it exists, it's replaced, if it doesn't, it is created.
Moray, your idea's good, I can probably get around by changing the script
Adding a simple script line that would build the config file from template
+ shares.d everytime I start the service.
*+33 6 37 90 81 98*
*Quark Systems & CAOBA*
*23 rue du Buisson Saint-Louis, 75010 Paris
On Fri, Feb 10, 2012 at 11:16, Moray Henderson <
Moray.Henderson at ict-software.org> wrote:
> > From: Santiago Diez [mailto:santiago.diez at caoba.fr]
> > Sent: 09 February 2012 18:04
> > Hi there,
> > I'm wondering if there any patch or recent developement that would
> > allow to
> > include a directory rather than a file in smb.conf
> > Something like
> > includedir = /etc/samba/shares.d/
> > instead of
> > include = /etc/samba/shares.conf
> > Thanks for your help
> We get around that by using script which builds smb.conf from a template
> the contents of a config directory. It would be nice to have the facility
> built in to Samba, though.
> "To err is human; to purr, feline."
More information about the samba