[ic] Restart and stop problems (multilple processes)

Jon Jensen interchange-users@icdevgroup.org
Thu Feb 6 13:15:01 2003


On Thu, 6 Feb 2003, Daniel Hutchison wrote:

> Looks like we were both wrong...  I was able to track the problem down
> to the read_pid() that was being called from the server_start_message()
> in lib/Vend/Server.pm.  It appears that read_pid() is releasing the lock
> when it opens and closes the pid file.
> 
> Anyway, here is a simple patch that fixes the problem on Solaris:
> 
> diff -rNu ../interchange-4.9.7-200301240658-orig/lib/Vend/Server.pm ./lib/Vend/Server.pm
> --- ../interchange-4.9.7-200301240658-orig/lib/Vend/Server.pm   Fri Dec 13 07:11:35 2002
> +++ ./lib/Vend/Server.pm        Thu Feb  6 10:40:21 2003
> @@ -1200,7 +1200,7 @@
>         push (@types, 'SOAP') if $Global::SOAP;
>         push (@types, 'mod_perl') if $Global::mod_perl;
>         my $server_type = join(" and ", @types);
> -       my $pid = read_pidfile();
> +       my $pid = $$;
>         my @args = $reverse ? ($server_type, $pid) : ($pid, $server_type);
>         return ::errmsg ($fmt , @args );
>  }

This patch will give incorrect output for Interchange running inside
mod_perl, where the running code is already in a child process and thus
has a different PID. There should be another way to handle this, but
offhand I don't know what it would be.

Jon