[Zope-dev] Xron running under linux

Homan Els homan@embl-grenoble.fr
Mon, 28 May 2001 16:21:39 +0100


--------------5683A9451869BFA4FAAA9745
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Nick,

The point is that linux has a different thread system then other platforms.
Under standard UNIX (hpux, sgi, etc.), you have the possibility to create a
thread. When creating one or more threads, you will have:
1 process with one or more threads sharing the same environment  (such as uid,
etc.). In this case, when changing a env. var. this will
be available in both threads.

But, when creating a thread in linux you will have:
for each thread one process (you can see this with ps -ef|grep python).   In
this case, when changing a env.var. this will give a problem, because the other
thread still have the old uid.

Zope is starting as root.  Zope initializes its products (create a thread) as
root, and then changes to user "nobody"
(or to user <....>given by -u ....  (in the startup).

So, the thread does have another uid, and this is giving the problem!

I just change my: rczope:

su wwwrun -c "$zope_start 2>/dev/null"

because in my start script, I call:
          exec /usr/local/zope/bin/python $PYTHONHOME/z2.py -u wwwrun -a
127.0.0.1 "$@"

You might need to chown the files in your zope directory.

I did try to run the Xron product and everything is working correctly now.

Enjoy it !.

Els


Nicholas Lo wrote:

> Hi Els,
>
> Sorry for I couldnt give you the code in time. BTW, what are your tricks in
> making Xron working under Linux??? If Xron works under Linux, I can throw
> away my old code and follow the Xron way.
>
> -- Nick
>
> ----- Original Message -----
> From: "Homan Els" <homan@embl-grenoble.fr>
> To: "Nicholas Lo" <nicklo@siliconcreation.com>
> Sent: Monday, May 28, 2001 6:47 PM
> Subject: [Fwd: [Zope-dev] Xron on linux: Dispatcher thread stops after a
> while]
>
> > Hi Nicholas,
> >
> > It is working !
> > (I will now try to test to correctness of the product).
> >
> > See email from Xron on linux.
> >
> > Regards,
> >
> > Els
> >
> >
> >

--------------5683A9451869BFA4FAAA9745
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Nick,
<p>The point is that linux has a different thread system then other platforms.&nbsp;
Under standard UNIX (hpux, sgi, etc.), you have the possibility to create
a thread. When creating one or more threads, you will have:
<br>1 process with one or more threads sharing the same environment&nbsp;
(such as uid, etc.). In this case, when changing a env. var. this will
<br>be available in both threads.
<p>But, when creating a thread in linux you will have:
<br>for each thread one process (you can see this with ps -ef|grep python).&nbsp;&nbsp;
In this case, when changing a env.var. this will give a problem, because
the other thread still have the old uid.
<p>Zope is starting as root.&nbsp; Zope initializes its products (create
a thread) as root, and then changes to user "nobody"&nbsp;&nbsp;
<br>(or to user &lt;....>given by -u ....&nbsp; (in the startup).
<p><font size=+2>So, the thread does have another uid, and this is giving
the problem!</font>
<p>I just change my: rczope:
<br>&nbsp;
<br>su wwwrun -c "$zope_start 2>/dev/null"
<p>because in my start script, I call:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec /usr/local/zope/bin/python
$PYTHONHOME/z2.py -u wwwrun -a 127.0.0.1 "$@"
<p>You might need to chown the files in your zope directory.
<p>I did try to run the Xron product and everything is working correctly
now.
<p>Enjoy it !.
<p>Els
<br>&nbsp;
<p>Nicholas Lo wrote:
<blockquote TYPE=CITE>Hi Els,
<p>Sorry for I couldnt give you the code in time. BTW, what are your tricks
in
<br>making Xron working under Linux??? If Xron works under Linux, I can
throw
<br>away my old code and follow the Xron way.
<p>-- Nick
<p>----- Original Message -----
<br>From: "Homan Els" &lt;homan@embl-grenoble.fr>
<br>To: "Nicholas Lo" &lt;nicklo@siliconcreation.com>
<br>Sent: Monday, May 28, 2001 6:47 PM
<br>Subject: [Fwd: [Zope-dev] Xron on linux: Dispatcher thread stops after
a
<br>while]
<p>> Hi Nicholas,
<br>>
<br>> It is working !
<br>> (I will now try to test to correctness of the product).
<br>>
<br>> See email from Xron on linux.
<br>>
<br>> Regards,
<br>>
<br>> Els
<br>>
<br>>
<br>></blockquote>
</html>

--------------5683A9451869BFA4FAAA9745--