Koozali.org: home of the SME Server

Oops, got myself in (and out of) hot water

Duncan

Oops, got myself in (and out of) hot water
« on: August 09, 2000, 02:36:12 AM »
Ah, the trials & tribulations of a newbie...

Prior to downloading the Samba patch to rein in the e-smith box from wrestling domain control from the resident NT server I had made changes to 2 Samba config files in the templates/smb.conf directory.

Not wanting to clobber anything I copied the original files as *.orig in case I need to restore the originals. Likewise, not wanting to lose my custom changes I also copied the customised scripts to *.custom within the template folder.

Oddly enough the e-smith machine refused to budge and retained its desire to rule the local network. I went in to the /etc/smb.conf to try to verify that the "master" values were all "no" and they were...or were they? Further on down the file if there wasnt a second version of the same settings...and a third set with the same fields but with the values all set to "yes"!

So it seems as tho the generated smb.conf file had all three copies of the config segment (the current config segment, the copy of the customization, and the copy of the original segment) appended as the file was rebuilt.

Is the morale of this story then to never place anything extraneous in the templates folder? I had assumed that the target file would have been constructed via a defined set of source segments but it seems as tho it is a wildcard assembly. Is this smb.conf behaviour also true for the multiple segments used to construct the httpd.conf file?

Anyway, can't say enough about how impressed I am with the installation & set up of a base system - works like a charm first crack. I'm also impressed with the prompt  support & receptive feedback seen within the forums. Keep up the great work.

Gordon Rowell

RE: Oops, got myself in (and out of) hot water
« Reply #1 on: August 09, 2000, 02:45:19 AM »
Duncan wrote:

> [...]
> Is the morale of this story then to never place anything extraneous in
>  the templates folder? I had assumed that the target file would have
> been constructed via a defined set of source segments but it seems as > tho it is a wildcard assembly. Is this smb.conf behaviour also true for
>  the multiple segments used to construct the httpd.conf file?

Any regular file in those directories will be assembled. The files named
template-begin and template-end will be inserted at start and end.
Otherwise it's just in alphabetical order.

However,  make use of the parallel hierarchy in /etc/e-smith/templates-custom instead.

mkdir -p /etc/e-smith/templates-custom/etc

cp -rp /etc/e-smith/templates/etc/httpd.conf  
                  /etc/e-smith/templates-custom/etc/

Then modify the copy in the templates-custom area. It will be used
in preference - you don't need .orig files.

> Anyway, can't say enough about how impressed I am with the
> installation & set up of a base system - works like a charm first crack. > I'm also impressed with the prompt support & receptive feedback
> seen within the forums. Keep up the great work.

Thanks on all of those points.

Gordon

Scott Smith

RE: Oops, got myself in (and out of) hot water
« Reply #2 on: August 11, 2000, 11:31:39 PM »
I found the "all files are processed" thing, similar to Duncan, just two days ago. I was not aware that template-begin and template-end were processed separately, though. That makes a big difference, as I was thinking it would be necessary to insert files in between those two names, such as template-custom01, template-custom02, etc. Nice to know that I don't have to worry about that one.

Also, how is the templates-custom actually handled. If a template-custom directory exists, then only the files in that directory are processed? Or are those files in addition to the normal templates? For example, what happens when:

     /etc/e-smith/templates/etc/hosts/template-begin
     /etc/e-smith/templates/etc/hosts/template-end

     /etc/e-smith/templates-custom/etc/hosts/custom1
     /etc/e-smith/templates-custom/etc/hosts/custom2

Which directory is processed? Both? Only custom? What is the impact of no begin/end in the templates-custom branch?

I assume the following scenario:

     /etc/e-smith/templates/var/qmail/control/smtproutes

     /etc/e-smith/templates-custom/var/qmail/control/smtproutes

would result in only the templates-custom version being expanded, right?

Is this also possible, then:

     /etc/e-smith/templates/var/qmail/control/smtproutes/template-begin
     /etc/e-smith/templates/var/qmail/control/smtproutes/template-end

Cool product. Wish I knew Perl, though. The nuts and bolts of some of the code might make a little more sense. But I'm getting there!

Gordon Rowell

RE: Oops, got myself in (and out of) hot water
« Reply #3 on: August 11, 2000, 11:40:46 PM »
Scott Smith wrote:

> [...]
> Also, how is the templates-custom actually handled.

In an identical manner to the equivalent templates directory:
   template-begin
   [...
      the rest in ASCII order
   ...]
   template-end

> If a template-custom directory exists, then only the files in that
> directory are processed?

Correct.

> Or are those files in addition to the
> normal templates?

No. It is a complete override - _at this stage_ - this may change
in the future.

> For example, what happens when:
>
> /etc/e-smith/templates/etc/hosts/template-begin
> /etc/e-smith/templates/etc/hosts/template-end
>
> /etc/e-smith/templates-custom/etc/hosts/custom1
> /etc/e-smith/templates-custom/etc/hosts/custom2
>
> Which directory is processed? Both? Only custom?

Only custom.

> What is the
> impact of no begin/end in the templates-custom branch?

A warning in the log.

> I assume the following scenario: ....
>  /etc/e-smith/templates/var/qmail/control/smtproutes
>   /etc/e-smith/templates-custom/var/qmail/control/smtproutes
>   would result in only the templates-custom version being
> expanded, right?

Correct.

> Is this also possible, then:

>/etc/e-smith/templates/var/qmail/control/smtproutes/template-begin
>/etc/e-smith/templates/var/qmail/control/smtproutes/template-end

Sure, but don't modify anything in /etc/e-smith/templates - copy them
across to templates-custom.

> Cool product.

Thanks.

> Wish I knew Perl, though. The nuts and bolts of some of the code
> might make a little more sense. But I'm getting there

Good luck,

Gordon

Charlie Brady

RE: Oops, got myself in (and out of) hot water
« Reply #4 on: August 11, 2000, 11:41:27 PM »
Scott Smith wrote:

> If a template-custom directory exists, then only the files in that
> directory are processed?

Correct. Although this may change in a future release.

> Or are those files in addition to the normal templates?

No, instead of.

> What is the impact of no begin/end in the templates-custom branch?

None. They are optional, but if they do exist they go first and last. We may choose to not ship those files in the future (and to use only smaller named fragments, as in /etc/smb.conf, for example), but they will always be sorted first and last if you happen to have them.

Regards

Charlie