Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Ran into additional issue with Supervisord.

Centos 6.5 supervisor python 2.6 installed with the OS python 2.7 installed in /usr/local/bin

supervisord program settings

[program:inf_svr]
process_name=inf_svr%(process_num)s
directory=/opt/inf_api/
environment=USER=root,PYTHONPATH=/usr/local/bin/
command=python2.7 /opt/inf_api/inf_server.py --port=%(process_num)s
startsecs=2
user=root
autostart=true
autorestart=true
numprocs=4
numprocs_start=8080
stderr_logfile = /var/log/supervisord/tornado-stderr.log
stdout_logfile = /var/log/supervisord/tornado-stdout.log

I can run inf_server.py with:

python2.7 inf_server.py --port=8080

with no problems. I made sure the files were executable (that was my problem before).

Any thoughts?

UPDATE: I cant get it to even launch a basic python script without failing. Started by commenting out the old program, adding a new one and then putting in:

command=python /opt/inf_api/test.py

where test.py just writes something to the screen and to a file. Fails with exit status 0. So I started adding back in the location of python (after discovering it with 'which python')

environment=PYTHONPATH=/usr/bin

Tried putting the path in single quote, tried adding USER=root, to the environment, tried adding

directory=opt/inf_api/

tried adding

user=root

All the same thing, exit status 0. Nothing seems to added to any log files either, except what Im seeing from the debug of supervisord.

Man I am at a loss.

UPDATE 2: So there is absolutely NOTHING in the stderr and std out logs for this. It just fails with (Exit Status 1; not expected) no errors from the program I am trying to run, nothing...

2014-03-05 11:25:01,027 INFO spawned: 'inf_svr' with pid 15542
2014-03-05 11:25:01,315 INFO exited: inf_svr (exit status 1; not expected)
2014-03-05 11:25:01,315 INFO received SIGCLD indicating a child quit

Update 3: I have a simple python script started and managed by supervisord using /usr/local/bin/python 2.7 so at least I know it can invoke using the different version of python passed.

However I am still getting an (error status 1, not expected) on the original script.

I added in some exception logging, and even just some print to file lines at the beginning of the script. Its like it never even makes it there, fails before it even launches.

share|improve this question

1 Answer 1

This turns out to be an issue with how Supervisord is catching error messages from python. As in it isnt. Im running it to launch a tornado app, that calls a second python file so it can spawn n instances of tornado servers. If there are errors in that second python app, then it isnt catching them and saving them to the log files. I tried all manner of methods but ended up having to catch them myself with try: except: and saving it to my own log files. Probably good paractice anyway but talk about a round about way of going about it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.