]> git.proxmox.com Git - pmg-api.git/commitdiff
log before restarting services on rewrite_config
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 11 Apr 2019 16:48:58 +0000 (18:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 12 Apr 2019 07:47:26 +0000 (09:47 +0200)
PMG::Config::rewrite_config is called from various places (e.g.
pmgmirror for clustered setups, pmgconfig sync --restart for CLI
operations) for rendering the config-templates and conditionally
restarting services.  This patch adds a syslog call for each service
that gets restarted.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PMG/Config.pm

index 6aa7d06e1334510dfabf2b7f6b79d766a80b51a1..ce931e558043ad5c88d7a7fdbf5f047d2f1a63cf 100755 (executable)
@@ -1552,6 +1552,7 @@ sub rewrite_config {
 
     if (($self->rewrite_config_postfix($rulecache) && $restart_services) ||
        $force_restart->{postfix}) {
+       syslog ('info', 'configuration change detected - postfix');
        PMG::Utils::service_cmd('postfix', 'reload');
     }
 
@@ -1566,16 +1567,19 @@ sub rewrite_config {
 
     if (($self->rewrite_config_spam() && $restart_services) ||
        $force_restart->{spam}) {
+       syslog ('info', 'configuration change detected - pmg-smtp-filter');
        PMG::Utils::service_cmd('pmg-smtp-filter', 'restart');
     }
 
     if (($self->rewrite_config_clam() && $restart_services) ||
        $force_restart->{clam}) {
+       syslog ('info', 'configuration change detected - clamav-daemon');
        PMG::Utils::service_cmd('clamav-daemon', 'restart');
     }
 
     if (($self->rewrite_config_freshclam() && $restart_services) ||
        $force_restart->{freshclam}) {
+       syslog ('info', 'configuration change detected - clamav-freshclam');
        PMG::Utils::service_cmd('clamav-freshclam', 'restart');
     }
 }