Discussion:
[Supervisor-users] subprocess.call from a python script spawned by supervisord
Daniel Peters
2014-03-12 19:44:39 UTC
Permalink
Hello all.

I have a flask app, very simple, which when a specific url is hit with json
from a github webhook, a subprocess.call is made to a shell script in the
directory of the app

call(['sh', 'pull_new.sh'])

this call then pulls in the updated repo, brings down the flask app, and
brings it back up again. This app is also being run in a virtualenv.
For whatever reason, when I run the app from the commandline, in tmux, the
call to sub.call is made and the script does what its supposed to do, but
when the app is started under supervisord nothing at all happens. I've
checked the stdout, and stderror of the childprocess logs and nothing shows
up, even when I include other bits of code specifically to print to stdout.


I've also fiddled with many of the settings in supervisor.conf, things like
enviornment, directory, etc.

supervisord is sharing the virtualenv and is being run from the same
directory as the app, with its conf file also in the same directory. I've
removed system versions of flask and supervisor in an attempt to completely
isolate the virtualenv.

Any thoughts at all would be deeply appreciated. Thank you for your time.
Roger Hoover
2014-03-12 21:18:11 UTC
Permalink
Did you check the main supervisor log (usually
/var/log/supervisor/supervisord.log)?
Post by Daniel Peters
Hello all.
I have a flask app, very simple, which when a specific url is hit with
json from a github webhook, a subprocess.call is made to a shell script in
the directory of the app
call(['sh', 'pull_new.sh'])
this call then pulls in the updated repo, brings down the flask app, and
brings it back up again. This app is also being run in a virtualenv.
For whatever reason, when I run the app from the commandline, in tmux, the
call to sub.call is made and the script does what its supposed to do, but
when the app is started under supervisord nothing at all happens. I've
checked the stdout, and stderror of the childprocess logs and nothing shows
up, even when I include other bits of code specifically to print to stdout.
I've also fiddled with many of the settings in supervisor.conf, things
like enviornment, directory, etc.
supervisord is sharing the virtualenv and is being run from the same
directory as the app, with its conf file also in the same directory. I've
removed system versions of flask and supervisor in an attempt to completely
isolate the virtualenv.
Any thoughts at all would be deeply appreciated. Thank you for your time.
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Daniel Peters
2014-03-12 21:47:04 UTC
Permalink
I did. Just went back and triple checked. Nothing. And it *is* logging
stderror for other things in the app, specifically I'm missing a css file,
so flask outputs a 404 not found for the file into stderror. Its weird.
Post by Roger Hoover
Did you check the main supervisor log (usually
/var/log/supervisor/supervisord.log)?
Post by Daniel Peters
Hello all.
I have a flask app, very simple, which when a specific url is hit with
json from a github webhook, a subprocess.call is made to a shell script in
the directory of the app
call(['sh', 'pull_new.sh'])
this call then pulls in the updated repo, brings down the flask app, and
brings it back up again. This app is also being run in a virtualenv.
For whatever reason, when I run the app from the commandline, in tmux,
the call to sub.call is made and the script does what its supposed to do,
but when the app is started under supervisord nothing at all happens. I've
checked the stdout, and stderror of the childprocess logs and nothing shows
up, even when I include other bits of code specifically to print to stdout.
I've also fiddled with many of the settings in supervisor.conf, things
like enviornment, directory, etc.
supervisord is sharing the virtualenv and is being run from the same
directory as the app, with its conf file also in the same directory. I've
removed system versions of flask and supervisor in an attempt to completely
isolate the virtualenv.
Any thoughts at all would be deeply appreciated. Thank you for your time.
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Roger Hoover
2014-03-12 22:15:05 UTC
Permalink
Is there a child process running? If so, you might get some clues from
/proc +/or connecting to it with strace.
Post by Daniel Peters
I did. Just went back and triple checked. Nothing. And it *is* logging
stderror for other things in the app, specifically I'm missing a css file,
so flask outputs a 404 not found for the file into stderror. Its weird.
Post by Roger Hoover
Did you check the main supervisor log (usually
/var/log/supervisor/supervisord.log)?
Post by Daniel Peters
Hello all.
I have a flask app, very simple, which when a specific url is hit with
json from a github webhook, a subprocess.call is made to a shell script in
the directory of the app
call(['sh', 'pull_new.sh'])
this call then pulls in the updated repo, brings down the flask app, and
brings it back up again. This app is also being run in a virtualenv.
For whatever reason, when I run the app from the commandline, in tmux,
the call to sub.call is made and the script does what its supposed to do,
but when the app is started under supervisord nothing at all happens. I've
checked the stdout, and stderror of the childprocess logs and nothing shows
up, even when I include other bits of code specifically to print to stdout.
I've also fiddled with many of the settings in supervisor.conf, things
like enviornment, directory, etc.
supervisord is sharing the virtualenv and is being run from the same
directory as the app, with its conf file also in the same directory. I've
removed system versions of flask and supervisor in an attempt to completely
isolate the virtualenv.
Any thoughts at all would be deeply appreciated. Thank you for your time.
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Daniel Peters
2014-03-12 22:18:38 UTC
Permalink
there we go. hadn't thought about that. like, its environment, etc.
Thanks for the tip, I'll try it out and get back to the list.
Post by Roger Hoover
Is there a child process running? If so, you might get some clues from
/proc +/or connecting to it with strace.
Post by Daniel Peters
I did. Just went back and triple checked. Nothing. And it *is* logging
stderror for other things in the app, specifically I'm missing a css file,
so flask outputs a 404 not found for the file into stderror. Its weird.
Post by Roger Hoover
Did you check the main supervisor log (usually
/var/log/supervisor/supervisord.log)?
Post by Daniel Peters
Hello all.
I have a flask app, very simple, which when a specific url is hit with
json from a github webhook, a subprocess.call is made to a shell script in
the directory of the app
call(['sh', 'pull_new.sh'])
this call then pulls in the updated repo, brings down the flask app,
and brings it back up again. This app is also being run in a virtualenv.
For whatever reason, when I run the app from the commandline, in tmux,
the call to sub.call is made and the script does what its supposed to do,
but when the app is started under supervisord nothing at all happens. I've
checked the stdout, and stderror of the childprocess logs and nothing shows
up, even when I include other bits of code specifically to print to stdout.
I've also fiddled with many of the settings in supervisor.conf, things
like enviornment, directory, etc.
supervisord is sharing the virtualenv and is being run from the same
directory as the app, with its conf file also in the same directory. I've
removed system versions of flask and supervisor in an attempt to completely
isolate the virtualenv.
Any thoughts at all would be deeply appreciated. Thank you for your time.
_______________________________________________
Supervisor-users mailing list
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Loading...