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
Philippe Jadin wrote:
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.
For 'su nobody' make sure the user nobody exists and has a valid login-shell (not /bin/false). This is my entry from /etc/passwd: nobody:x:65534:65534:nobody:/var/lib/nobody:/bin/bash Tilo
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 )
Hi Philippe, --On Freitag, 17. August 2001 11:42 +0200 Philippe Jadin <philippe@123piano.com> wrote:
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")
Did you try absolute paths for the images also? I suspect the "current dir" for external methods is the zope root. Regards Tino
participants (4)
-
Andreas Jung -
Philippe Jadin -
Tilo Renz -
Tino Wildenhain