Koozali.org: home of the SME Server

e-smith custom expansions

Hasan Muhammad

e-smith custom expansions
« on: August 02, 2000, 07:04:41 PM »
I've love how I can copy a subdirectory from
/etc/e-smith/templates/etc
to
/etc/e-smith/templates-custom/etc

and then use /sbin/e-smith/expand-template
and not have to worry about those customizations being overwritten by an
upgrade; also in the event of a re-installation from scratch I can just restore
from a backup from templates-custom EXCEPT for dependencies in the
/etc/e-smith/event directory tree.

I would love a '/sbin/e-smith/expand-events' script so those customizations
could be easily restored from a backup in the event of a re-installation.

Hasan

Charlie Brady

RE: e-smith custom expansions
« Reply #1 on: August 02, 2000, 10:52:16 PM »
Hasan Muhammad wrote:

> I've love how I can copy a subdirectory from
> /etc/e-smith/templates/etc to /etc/e-smith/templates-custom/etc
>
> and then use /sbin/e-smith/expand-template and not have to
> worry about those customizations being overwritten by an
> upgrade; also in the event of a re-installation from scratch I
> can just restore from a backup from templates-custom EXCEPT for
> dependencies in the /etc/e-smith/event directory tree.

Just a word of warning - the built-in backup function from the e-smith-manager does not backup the /etc/e-smith/templates-custom directory - so you need to keep your own copy of your customisations.

I've made an entry in our bug database so that this omission will be fixed in future releases.

> I would love a '/sbin/e-smith/expand-events' script so those
> customizations could be easily restored from a backup in the
> event of a re-installation.

I don't understand what you are suggesting here. There is already the
"signal-event" command, and there is already a "post-restore" event - the web interface restore already does a:

/sbin/e-smith/signal-event post-restore

after it replaces files from a backup.

Charlie

Gordon Rowell

RE: e-smith custom expansions
« Reply #2 on: August 02, 2000, 11:01:49 PM »
Charlie Brady wrote:

> Hasan Muhammad wrote:
>
> > I've love how I can copy a subdirectory from
> > /etc/e-smith/templates/etc to /etc/e-smith/templates-custom/etc
> > and then use /sbin/e-smith/expand-template and not
> > have to worry about those customizations being overwritten
> > by an upgrade;

Thanks - I'm rather fond of that feature myself :-)

> [...]
> Just a word of warning - the built-in backup function from the
> e-smith-manager does not backup the
> /etc/e-smith/templates-custom directory - so you need to keep
> your own copy of your customisations.
> [...]

And another word of warning. The downside of the templates-custom
area is that it does what it is designed to do - it overrides the shipped
templates with your local modifications.

So, if you do an upgrade, you will need to check your local
templates to make sure that they are compatible with any changes e-smith may make in later releases.

There is a log entry generated whenever a templates-custom template is used.

Gordon

Hasan Muhammad

RE: e-smith custom expansions
« Reply #3 on: August 04, 2000, 02:39:28 AM »
I must admit that I don't yet fully understand the operation of these customization scripts.

I understand that I can make changes in the .../templates-custom/ directories then run .../expand-templates and poof... the intented changes will magically appear in the /etc files and directories.

I can also 'diff -ru ../templates-custom/.. ../templates/.. ' and easily find any changes from a stock (or upgraded) installation.

These are all good things... however the problem I see is that some customizations involve adding some files (and maybe modifing some others) in the
/etc/e-smith/events directory tree.  I'm concerned that later upgrades may clobber thecustomizations.

So what I've done is create a ../events-custom/.. directory tree where I make the customizations, then I 'cp -pr * ' the changes into ../events/..
so I at least have a separate copy of my customizations in the event of restoration or upgrade problems.

I just thought some kind of /sbin/e-smith/expand-events would be more elegant.

Hasan

Gordon Rowell

RE: e-smith custom expansions
« Reply #4 on: August 04, 2000, 03:05:56 AM »
Hasan Muhammad wrote:

> [...]
> I just thought some kind of /sbin/e-smith/expand-events would be
> more elegant

OK, I think you've hit a philosophical issue here.

The idea of templates-custom was to modify the behaviour of the
existing services - e.g. change policy for hosts.allow, etc.

I view adding extra services as something that should only be done
via the install of an additional RPM. That RPM can install events,
add new template fragments to /etc/e-smith/templates, add new
web panels, as required.
 
The writer of the RPM can choose default behaviour for their new
service.

This can then be customised through template modifications in
/etc/e-smith/templates-custom

So, to reinstall your services/events, you would just re-install the
relevant RPM.  And if any local overrides have been done, you
reinstall the files in /etc/e-smith/templates-custom (which you might
also like to build into your local site RPM to make it easy).

Have a look at

ftp://ftp.e-smittp://ftp.e-smith.net/pub/e-smith/contrib/charlieb/

for some examples.

Gordon

Gordon Rowell

RE: e-smith custom expansions
« Reply #5 on: August 04, 2000, 03:11:23 AM »
Oh dear, cut&paste can be fun in Phorum :-(

Let's try that again, the URL should be:

ftp://ftp.e-smith.net/pub/e-smith/contrib/charlieb/

Gordon

Hasan Muhammad

RE: e-smith custom expansions
« Reply #6 on: August 05, 2000, 07:13:43 AM »
Thanks... I reread www.e-smith.org/custom and I see where I went astray.

I was adding ../events/actions/.. and ../events/console-save links when I was modifying configuration files for services that already existed.

I looking forward to studying the examples you mentioned.

Hasan