diff options
author | Mathieu Parent <math.parent@gmail.com> | 2008-11-17 19:37:08 (GMT) |
---|---|---|
committer | Mathieu Parent <math.parent@gmail.com> | 2008-11-17 19:37:08 (GMT) |
commit | a1dfdbc6f9c54bc7b10282d29a5ad1b850b6473a (patch) | |
tree | badf9bee3543d397bda8995c0f22103f6698d318 | |
parent | 67aab8cc9a402438719aa4496b9954351baca8c1 (diff) | |
download | perl-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-- | ChangeLog | 12 | ||||
-rw-r--r-- | lib/Kolab/Conf.pm | 9 |
2 files changed, 19 insertions, 2 deletions
@@ -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 ); |