[pmg-devel] applied: [PATCH pmg-api 2/2] PMG::Config::rewrite_config: log before restarting
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Apr 12 10:01:49 CEST 2019
On 4/11/19 6:48 PM, Stoiko Ivanov wrote:
> 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 at proxmox.com>
> ---
> PMG/Config.pm | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/PMG/Config.pm b/PMG/Config.pm
> index 6aa7d06..ce931e5 100755
> --- a/PMG/Config.pm
> +++ b/PMG/Config.pm
> @@ -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');
> }
> }
>
applied, thanks.
More information about the pmg-devel
mailing list