gunnar: server/perl-kolab/lib/Kolab Conf.pm,1.4,1.4.2.1

cvs at kolab.org cvs at kolab.org
Mon Dec 7 16:17:21 CET 2009


Author: gunnar

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

Modified Files:
      Tag: kolab_2_2_branch
	Conf.pm 
Log Message:
MFH:  kolab/issue3951 (kolabconf -n (noreload) restarts services if RUNONCHANGE is used)

Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/lib/Kolab/Conf.pm,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- Conf.pm	4 Mar 2009 11:51:36 -0000	1.4
+++ Conf.pm	7 Dec 2009 15:17:19 -0000	1.4.2.1
@@ -774,6 +774,18 @@
 	{
 	    Kolab::log('T', 'Actioning RUNONCHANGE for '.$key, KOLAB_DEBUG );
 	    my $cmd = $runonchange{$key};
+	    # $cmd can contain:
+	    # - /usr/sbin/postmap: should always be executed
+	    # - openpkg rc imapd restart (in openpkg distribution)
+	    # - kolabsrv rc post reload  (in other distributions)
+	    # The commands with ' rc ' may only be executed when reloading is not
+	    # prohibited by the user with the "-n" option.
+	    if ($Kolab::do_reload || $cmd !~ / rc \S+ re(start|load)/) {
+		Kolab::log('T', 'Executing command: '.$cmd, KOLAB_DEBUG );
+		system($cmd);
+	    } else {
+		Kolab::log('T', 'Reload not allowed, not executing command: '.$cmd, KOLAB_DEBUG );
+	    }
 	    system($cmd);
 	    Kolab::log('T', 'Executing command', KOLAB_DEBUG );
 	}





More information about the commits mailing list