diff options
author | Richard Bos <richard@radoeka.nl> | 2009-11-24 18:44:58 (GMT) |
---|---|---|
committer | Richard Bos <richard@radoeka.nl> | 2009-11-24 18:44:58 (GMT) |
commit | e9972cf6c8c5ae046aed51c98e450f18f3cc6216 (patch) | |
tree | f83094c46fb398f787e2ead71dc8fff68c513ca1 /lib | |
parent | c632bea10e378a1f7177998198b0f7e7c293abbe (diff) | |
download | perl-Kolab-e9972cf6c8c5ae046aed51c98e450f18f3cc6216.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kolab/Conf.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Kolab/Conf.pm b/lib/Kolab/Conf.pm index 3491795..9d12855 100644 --- a/lib/Kolab/Conf.pm +++ b/lib/Kolab/Conf.pm @@ -741,8 +741,18 @@ sub rebuildTemplates } my $cmd; foreach $cmd (keys %cmds) { - Kolab::log('T', 'Executing command: '.$cmd, KOLAB_DEBUG ); - system($cmd); + # $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 ); + } } } |