[Zope] pcgi fails with only included python

Andreas Kostyrka andreas@mtg.co.at
Thu, 2 Sep 1999 23:06:07 +0200 (CEST)


On Thu, 2 Sep 1999, Albert Kinderman wrote:

> I just did a fresh install of Zope 2.0 on a new RedHat 6.0 system. 
> Using apache, the Zope.cgi failed with a connection refused (102)
> failure during connect from pcgi-wrapper.
> 
> Zope.cgi points to /usr/local/Zope/bin/python as the PCGI_EXE, which
> should be 1.5.2 as required.  However, the installed python on RedHat
> 6.0 was 1.5.1.  
Use the RPMs on http://www.zope.at/mze/. 
They include a small patch to make pcgi work with nonstandard python
installations. (Actually, pcgi fails if there is another python in the
PATH before it.)

> Is it possible to configure pcgi-wrapper to run correctly with only
> Zope/bin/python installed on the system?
Not as it is currently delivered. :(

Here is the patch to pcgi-wrapper, it seems to work with 2.0final too.

diff -uNr Zope-2.0.0b5-src.org/pcgi/pcgi-wrapper.c Zope-2.0.0b5-src/pcgi/pcgi-wrapper.c
--- Zope-2.0.0b5-src.org/pcgi/pcgi-wrapper.c	Thu Dec  3 23:43:03 1998
+++ Zope-2.0.0b5-src/pcgi/pcgi-wrapper.c	Sat Aug 21 16:12:19 1999
@@ -723,20 +723,10 @@
 int pcgiStartProc(pcgiResource *r)
 {   
     pid_t pid;
-    char  *p = NULL;
     int   i = 0;
     UNION_SEMUN arg;
     arg.val=0;
 
-    if ((p=strrchr(r->sw_exe, PATHSEP))==NULL)
-    {   
-        p = r->sw_exe;
-    }
-    else
-    {   
-        p++;
-    }
-
     /* Set up signal handlers to coordinate timing */
     signal(SIGUSR1, pcgiSIG);
     signal(SIGUSR2, pcgiSIG);
@@ -823,7 +813,7 @@
         }
 
         execl(r->sw_exe,
-              p,
+              r->sw_exe,
               r->pubpath,
               (char *)0);
         exit(0);           

Andreas
--
Andreas Kostyrka                     | andreas@mtg.co.at
phone: +43/1/7070750                 | phone: +43/676/4091256   
MTG Handelsges.m.b.H.                | fax:   +43/1/7065299
Raiffeisenstr. 16/9                  | 2320 Zwoelfaxing AUSTRIA