summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2009-12-07 15:17:19 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2009-12-07 15:17:19 (GMT)
commit4ee7026fee6ff86dd757474a264a702c3d146320 (patch)
tree99203043644862db04a44e64b67a4fbc578636e3
parent73d3294a336d2f112efa36e78f9002e1158c49e7 (diff)
downloadperl-Kolab-4ee7026fee6ff86dd757474a264a702c3d146320.tar.gz
MFH: kolab/issue3951 (kolabconf -n (noreload) restarts services if RUNONCHANGE is used)
-rw-r--r--ChangeLog9
-rw-r--r--lib/Kolab/Conf.pm12
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d54f745..e3669fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2009-12-07 root <Gunnar Wrobel <wrobel@pardus.de>>
+2009-12-07 Gunnar Wrobel <wrobel@pardus.de>
* lib/Kolab/LDAP.pm (createObject): kolab/issue1448 (Users might
add an account on the nonHome Server and write emails in there.)
@@ -21,6 +21,13 @@
* Makefile.PL: kolab/issue3952 (Version in kolabconf is not
replaced in the build process)
+2009-11-24 Richard Bos <richard@radoeka.nl>
+
+ * sbin/kolabconf.in, lib/Kolab/Conf.pm: renamed variable do_reload
+ to $Kolab::do_reload, to make it a global variable. This is needed
+ to solve kolab/issue3951: kolabconf -n (noreload) restarts services
+ if RUNONCHANGE is used
+
2009-11-17 Gunnar Wrobel <wrobel@pardus.de>
* bin/kolabpasswd.in: kolab/issue919 (kolab server has problems
diff --git a/lib/Kolab/Conf.pm b/lib/Kolab/Conf.pm
index 8e34d78..9801771 100644
--- a/lib/Kolab/Conf.pm
+++ b/lib/Kolab/Conf.pm
@@ -774,6 +774,18 @@ sub rebuildTemplates
{
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 );
}