Koozali.org: home of the SME Server

How do the custom templates work?

Greg Zartman

How do the custom templates work?
« on: September 20, 2001, 12:09:22 AM »
I'm new to e-smith, but moderately experienced with Linux.

Could someone please explain to me how the custom-templates work?  I generally understand the concept, but I'm not sure how the naming convention works.

For example, if I want to customize the smb.conf file, by making customizing templates, how would I do this?  What do the numbers before the template names mean (e.g., 21netlogon)?

Thank you.

Greg

Scott Smith

Re: How do the custom templates work?
« Reply #1 on: September 20, 2001, 01:30:15 AM »
Greg Zartman wrote:

> Could someone please explain to me how the custom-templates
> work?  I generally understand the concept, but I'm not sure
> how the naming convention works.

I'll assume you understand to concept of duplicate directory trees under ./templates and ./templates-custom, and that those directory trees are relative to the root (ie, templates for /etc are found in ./templates/etc/* and ./templates-custom/etc/*) When there are same-named templates in both trees, the custom template is processed and the other is ignored. This allows you to customize without having to change the originals.

A template can be a single file, such as ./templates/etc/fetchmail, or it can be a directory of template fragments, such as smb.conf.

> For example, if I want to customize the smb.conf file, by
> making customizing templates, how would I do this?  What do
> the numbers before the template names mean (e.g., 21netlogon)?

The number are simply there for sequencing. In a directory-based template, the template-begin file is processed first and template-end is processed last. The other files are processed in name sorted order. So, in smb.conf, the processing order might be (these are not from the current version, btw, but the concept is identical):

template-begin
10globals
20netlogon
20printing
50homes
50printers
60netlogonshare
60primary
90ibays
template-end

If multiple files have the same number, then name determines the order (see 50homes and 50printers.)

Hope this clears it up a bit :-)

Scott

Greg Zartman

Re: How do the custom templates work?
« Reply #2 on: September 20, 2001, 01:54:01 AM »
Excellent,  that's exactly what I was looking for.  Thanks.

Gordon Rowell

Re: How do the custom templates work?
« Reply #3 on: September 20, 2001, 04:24:27 AM »
Greg Zartman wrote:
>
> Excellent,  that's exactly what I was looking for.  Thanks.

I would also urge you to read the documents under "e-smith design and architecture" on www.e-smith.org, including:

http://www.e-smith.org/custom/

Thanks,

Gordon