mathieu: server/perl-kolab/lib/Kolab Conf.pm,1.1,1.2

cvs at kolab.org cvs at kolab.org
Mon Nov 17 20:37:10 CET 2008


Author: mathieu

Update of /kolabrepository/server/perl-kolab/lib/Kolab
In directory doto:/tmp/cvs-serv27790/perl-kolab/lib/Kolab

Modified Files:
	Conf.pm 
Log Message:
  - 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).



Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/lib/Kolab/Conf.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Conf.pm	10 Oct 2008 14:22:04 -0000	1.1
+++ Conf.pm	17 Nov 2008 19:37:08 -0000	1.2
@@ -137,6 +137,11 @@
 	);
 
     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 @@
 #} 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 @@
     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 );





More information about the commits mailing list