[Zope] os.system in external method

Andreas Jung Andreas Jung" <andreas@andreas-jung.com
Fri, 17 Aug 2001 07:03:04 -0400


Looks like a permission problem. Try to run the same command as used nobody
and check if it works.

Andreas
----- Original Message ----- 
From: "Philippe Jadin" <philippe@123piano.com>
To: <zope@zope.org>
Sent: Freitag, 17. August 2001 05:42
Subject: [Zope] os.system in external method


> Hello,
> 
> I'm trying to execute an external command from an external method. 
> Altough it works when I do it from the python console, like :
> 
> $ python
> 
>  >>> import os
>  >>> os.system("/usr/local/zope/instance/var/images/jpeg2swf ABALONE.JPG 
> out.swf")
> 
> It works and return 0 (under both root and my user account). btw I 
> cannot 'su nobody' (user currently not available) for testing this as 
> nobody.
> 
> Fine.
> 
> But when I try this in an external method from zope, like this :
> 
> def execute(self):
>  import os
>  return os.system("/usr/local/zope/instance/var/images/jpeg2swf 
> ABALONE.JPG out.swf")
> 
> It returns a number : 64768 ("error code fomr the command ?)
> 
> I guess it's because zope runs under nobody or something like that, but 
> I'm not sure...
> 
> Do you think there are differences between external methods and the 
> python console beside the user running it? If not, how could I force 
> zope to run my command as another user?
> 
> I'm on freebsd.
> 
> BTW, the jpeg2swf command is chmod 777 for testing purpose.
> 
> What would you do ?
> 
> Thanks !
> 
> Philippe
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )