summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Parent <math.parent@gmail.com>2008-11-17 19:37:08 (GMT)
committerMathieu Parent <math.parent@gmail.com>2008-11-17 19:37:08 (GMT)
commita1dfdbc6f9c54bc7b10282d29a5ad1b850b6473a (patch)
treebadf9bee3543d397bda8995c0f22103f6698d318
parent67aab8cc9a402438719aa4496b9954351baca8c1 (diff)
downloadperl-Kolab-a1dfdbc6f9c54bc7b10282d29a5ad1b850b6473a.tar.gz
- RUNONCHANGE should also be triggered
when creating a file - it was not catching for some special config files (postfix, slapd, ...) - the debug log was not showing the template name see kolab/issue1679 ([kolabconf] Update template META mechanism to support service restarts).
-rw-r--r--ChangeLog12
-rw-r--r--lib/Kolab/Conf.pm9
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cd0cc5..8632243 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-11-17 Mathieu Parent <math.parent@gmail.com>
+
+ * lib/Kolab/Conf.pm:
+ - RUNONCHANGE should also be triggered
+ when creating a file
+ - it was not catching for some special config
+ files (postfix, slapd, ...)
+ - the debug log was not showing the
+ template name
+ see kolab/issue1679 ([kolabconf] Update template META mechanism
+ to support service restarts).
+
2008-11-08 Gunnar Wrobel <p@rdus.de>
* bin/kolabquotawarn (fatal_exit): Replace hardcoded path.
diff --git a/lib/Kolab/Conf.pm b/lib/Kolab/Conf.pm
index 003d938..8ac43a7 100644
--- a/lib/Kolab/Conf.pm
+++ b/lib/Kolab/Conf.pm
@@ -137,6 +137,11 @@ sub build {
);
my $oldmask = umask 077;
+ #creating the config file is changing it
+ if (! -f $cfg) {
+ $templatehaschanged{$tmpl} = 1;
+ Kolab::log('T', "`$cfg' creation detected", KOLAB_DEBUG );
+ }
copy($cfg, $oldcfg);
#chown($Kolab::config{'kolab_uid'}, $Kolab::config{'kolab_gid'}, $oldcfg);
# To avoid warnings, the backup files must be owned by root
@@ -301,8 +306,8 @@ sub build {
#} elsif ($cfg =~ /example/) {
} else {
Kolab::log('T', "`$cfg' change detected ", KOLAB_DEBUG );
- $templatehaschanged{$tmpl} = 1;
}
+ $templatehaschanged{$tmpl} = 1;
Kolab::log('T', "`$cfg' change detected: $rc", KOLAB_DEBUG );
}
@@ -758,7 +763,7 @@ sub rebuildTemplates
foreach $key (keys %runonchange) {
if (defined $templatehaschanged{$key})
{
- Kolab::log('T', 'Actioning RUNONCHANGE for $key', KOLAB_DEBUG );
+ Kolab::log('T', 'Actioning RUNONCHANGE for '.$key, KOLAB_DEBUG );
my $cmd = $runonchange{$key};
system($cmd);
Kolab::log('T', 'Executing command', KOLAB_DEBUG );