summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2009-05-05 13:05:49 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2009-05-05 13:05:49 (GMT)
commit226d4c184916533fa4fa512d804e79046f170fc3 (patch)
tree4e542f4204f1a332c4ac3ee60a1e2c1296749287 /lib
parent6a2717cbfb6d3d8cd7d865afd4a6d5c2df963cfd (diff)
downloadperl-Kolab-226d4c184916533fa4fa512d804e79046f170fc3.tar.gz
Execute duplicate RUNONCHANGE commands only once.
Part of kolab/issue1679 ([kolabconf] Update template META mechanism to support service restarts)
Diffstat (limited to 'lib')
-rw-r--r--lib/Kolab/Conf.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Kolab/Conf.pm b/lib/Kolab/Conf.pm
index f5a46d4..7d902fe 100644
--- a/lib/Kolab/Conf.pm
+++ b/lib/Kolab/Conf.pm
@@ -733,15 +733,19 @@ sub rebuildTemplates
Kolab::log('T', 'Finished regenerating configuration files', KOLAB_DEBUG );
+ my %cmds = ();
foreach $key (keys %runonchange) {
if (defined $templatehaschanged{$key})
{
- Kolab::log('T', 'Actioning RUNONCHANGE for '.$key, KOLAB_DEBUG );
- my $cmd = $runonchange{$key};
- system($cmd);
- Kolab::log('T', 'Executing command', KOLAB_DEBUG );
+ Kolab::log('T', 'Queueing RUNONCHANGE for '.$key, KOLAB_DEBUG );
+ $cmds{$runonchange{$key}} = 1;
}
}
+ my $cmd;
+ foreach $cmd (keys %cmds) {
+ Kolab::log('T', 'Executing command: '.$cmd, KOLAB_DEBUG );
+ system($cmd);
+ }
}
sub bootstrapConfig