print STDERR "syncing master configuration from '${master_ip}'\n";
- PMG::Cluster::sync_config_from_master($master_name, $master_ip);
+ my $restart = PMG::Cluster::sync_config_from_master($master_name, $master_ip);
my $cfg = PMG::Config->new();
$cfg->rewrite_config(undef, 1);
+ if (scalar(keys %$restart)) {
+ print "please restart the following daemons:\n";
+ for my $service (sort keys %$restart) {
+ print "$service\n"
+ }
+ }
+
return undef;
}});
my $force_restart = {};
if ($cond_commit_synced_file->($sa_custom_cf, "${sa_conf_dir}/${sa_custom_cf}")) {
- $force_restart->{spam} = 1;
+ $force_restart->{'pmg-smtp-filter'} = 1;
}
$cond_commit_synced_file->('pmg.conf');
+ return $force_restart;
}
sub sync_ruledb_from_master {
use PMG::Cluster;
use PMG::ClusterConfig;
use PMG::Statistic;
+use PMG::Utils;
use base qw(PVE::Daemon);
my $master_ip = $cinfo->{master}->{ip};
my $master_name = $cinfo->{master}->{name};
+ my $force_restart = {};
if ($role ne 'master') {
- PMG::Cluster::sync_config_from_master($master_name, $master_ip);
+ $force_restart = PMG::Cluster::sync_config_from_master($master_name, $master_ip);
}
my $csynctime = tv_interval($start_time);
"(files %.2f, database %.2f, config %.2f))",
$errcount, $cptime, $rsynctime, $dbtime, $csynctime));
+ foreach my $service (keys %$force_restart) {
+ PMG::Utils::service_cmd($service, 'restart');
+ }
}
sub run {