os.system
Stephen Klassen
sklassen at nospam_cncx.com
Tue Dec 7 11:39:45 EST 1999
Most webservers run as the user 'nobody'. Unless there was a clear path to
this script and the script was runable by everyone it wouldn't work. Check
your perms (man chmod).
Jim Richardson wrote:
> On Sat, 04 Dec 99 19:49:03 GMT,
> David Smead, in the persona of <smead at amplepower.com>,
> brought forth the following words...:
>
> >This works in the test mode, but jeeps isn't called when executed as a
> >CGI. Any comments would be appreciated.
> >
> >#!/usr/bin/python
> >import sys, cgi, string, os
> >print "content-type: text/html"
> >print
> >print "<title>Python Rules!</title>"
> >print "<body><br>"
> >sys.stdout.write('who done it?') # no \n at the end
> >print "junk"
> >
> >os.system("jeeps") #doesn't get called when CGI
> >
> >print "</body>"
> >print "</html>"
> >if __name__=="__main__": cgi.test()
> >
> >------- here's the script called jeeps
> >
> >#!/bin/sh
> >date > jnkdate
> >
> I don't have the solution, but I do know (at least I _think_ I
> know) the problem. The return value of the os.system call, is the
> error if any of the function, if jeeps runs fine with no returned
> error, then the value of return to os.system is either null or 0.
> Hope someone has the solution, 'cause I am trying to write a
> simple "click here for a fortune" cgi to help me in the learning
> of how to type and chew gum at the same time.
> --
> Jim Richardson
> Anarchist, pagan and proud of it
> WWW.eskimo.com/~warlock
> Linux, because life's too short for a buggy OS.
More information about the Python-list
mailing list