Supervisor supports huey python running

I am trying to get the supervisor to control and maintain a python script that using Huey (redis type queue).

The configuration of the Supervisor program is as follows:

[program:smsbot_handler]
directory=/home/ubuntu/virt_env/virt1/app/
command=/home/ubuntu/virt_env/virt1/bin/huey_consumer.py main.huey --threads=3
stdout_logfile=/home/ubuntu/smsbot_handler_log.txt
autostart=true
autorestart=true
environment=PYTHONPATH="/home/ubuntu/virt_env/virt1/app:$PYTHONPATH"
redirect_stderr=true

Can someone tell me why this is not working? All that I get in my log file:

Error importing main.huey

It really starts me to me!

+4
source share
1 answer

, , , , , script, huey_consumer.py script ( exec python).

, , .

:

:

[program:MyExample]
command=/ama/nms/MyExample/supervisor_myexample.sh
process_name=%(program_name)s ; process_name expr (default %(program_name)s)
numprocs=1                    ; number of processes copies to start (def 1)
directory=/ama/nms/MyExample  ; directory to cwd to before exec (def no cwd)
priority=10                   ; the relative start priority (default 999)
autostart=true                ; start at supervisord start (default: true)
autorestart=true              ; retstart at unexpected quit (default: true)
startsecs=1                   ; number of secs prog must stay running (def. 1)
startretries=10                ; max # of serial start failures (default 3)
exitcodes=0,2                 ; 'expected' exit codes for process (default 0,2)
stopsignal=TERM               ; signal used to kill process (default TERM)
stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)

/ama/nms/MyExample/supervisor _myexample.sh:

#!/bin/sh
# ------------------------------------------

# Set the environment
export LD_LIBRARY_PATH=<...>:$LD_LIBRARY_PATH
export PYTHONPATH=<...>:$PYTHONPATH

D=`dirname $0`
exec python $D/myexample.py arg1 arg2 arg3

exec, pid .

+3

All Articles