[pmg-devel] [PATCH api v4 02/10] pmg-smtp-filter: move pid file into /run/pmg-smtp-filter

Fiona Ebner f.ebner at proxmox.com
Fri Jul 12 11:54:11 CEST 2024


Am 10.07.24 um 16:35 schrieb Maximiliano Sandoval:
> diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm
> index 5d9ded4..09cb42d 100644
> --- a/src/PMG/Utils.pm
> +++ b/src/PMG/Utils.pm
> @@ -1462,7 +1462,7 @@ sub get_pg_server_version {
>  
>  sub reload_smtp_filter {
>  
> -    my $pid_file = '/run/pmg-smtp-filter.pid';
> +    my $pid_file = '/run/pmg-smtp-filter/pmg-smtp-filter.pid';
>      my $pid = PVE::Tools::file_read_firstline($pid_file);
>  
>      return 0 if !$pid;

Can there be a race here during/after update? I.e. service still running
with PID file in old path and reload_smtp_filter() is called only
checking the new path. Does something ensure this can't happen?
Otherwise, I suppose we'll need to check the old path too until the next
major release.

And what about the other way around, i.e. service already running with
PID file in new path and old version of reload_smtp_filter() called
still checking the old path?




More information about the pmg-devel mailing list