Haven't figured out how to template configuration change that occurs only once, but the following solution does...
a) effect templating of some actions that occurs each time the server is rebooted (hopefully not often)
b) because the configuration changes are inside of /etc/e-smith/templates-custom then the changes are documented in source code, which is my objective (quick-and-dirty versus building a rpm)
Note: The first file below is an example of how to use the templates-custom directory to create a new file (versus modifying an existing file), but the file is created with default ownership and persmissions.
Anybody know how to setup templates such that expanding the templates can also change the ownership/permissions?
Anyway...
--The (partial) Solution----------------------------------------------------------------------------------------
1) create a file...
/etc/e-smith/templates-custom/etc/e-smith/events/actions/disable-some-services-on-boot
with the following content...
(note this example expands to a shell script, but the strange beginning and ending lines also allows a perl script inside a template to be expanded)
{ # DO NOT CHANGE THESE First Two LINES
$OUT=<<'EOF_SCRIPT'; # DO NOT CHANGE THESE First Two LINES
#!/bin/sh
/sbin/e-smith/config setprop tinydns status disabled # per each service
/sbin/e-smith/signal-event console-save
exit 0
EOF_SCRIPT
$OUT =~ s/(.+)\n$/$1/s; # DO NOT CHANGE THESE Last Three LINES
}
{
# VERY IMPORTANT
#
# besure to chmod 554 this_file after running expand-template the first time
}
2) create a file...
/etc/e-smith/templates-custom/etc/e-smith/events/actions/disable-some-services-on-boot
with the following content...
{
exec('[ -a /etc/e-smith/events/local/S08disable-some-services-on-boot ] || ln -s /etc/e-smith/events/actions/disable-some-services-on-boot /etc/e-smith/events/local/S08disable-some-services-on-boot');
}
3) run these commands
/sbin/e-smith/expand-template /etc/e-smith/events/actions/disable-some-services-on-boot
chmod 554 /etc/e-smith/events/actions/disable-some-services-on-boot
/sbin/e-smith/expand-template /etc/e-smith/events/local/S08disable-some-services-on-boot
[%sig%]