I'm using mod_wsgi apache2 adapter for a django site and I like to call some bash process within a view, using the usual
...
p = subprocess.Popen("/home/example.com/restart-tomcat.sh", shell=True)
sts = os.waitpid(p.pid, 0)[1]
...
This code works perfectly from within a usual python shell but does nothing (I can trace right now) when called within django. Am I missing some wsgi constraints? The script has 755 perms, so it should be executable.
A quick test
p = subprocess.Popen("date >> home/example.com/wsgi-test.txt", shell=True)
sts = os.waitpid(p.pid, 0)[1]
reveals that it does not even executes trivial commands. I am out of ideas at the moment and thankful for any input.
Thanks.