2017-07-14 56 views
0

我在Django应用程序中使用芹菜。我正在使用特定的用户来运行应用程序。我可以运行django服务器与特定的用户 - 部署者,但不能与该用户运行芹菜过程。它以root用户启动芹菜。所以,我不能使用该用户配置文件中的环境变量(〜/ .bashrc)。用特定的linux用户运行芹菜

配置芹菜:

[program:celery_supervisor] 
environment=PYTHONPATH=PYTHONPATH:/usr/local/koob/fireball/ 
direcotry=/usr/local/koob/fireball/ 
command=/usr/local/koob/fireball/env/bin/python /usr/local/koob/fireball/env/bin/celery -A fireball worker -l info 
autostart=true 
autorestart=true 
user=deployer 
stderr_logfile=/usr/local/koob/fireball/celery.err.log 
stdout_logfile=/usr/local/koob/fireball/celery.out.log 

的Django的配置:

[program:fireball_supervisor] 
directory=/usr/local/koob/fireball/ 
environment=PLAY_ENV=production 
command=uwsgi --ini fireball.ini 
autostart=true 
autorestart=true 
stderr_logfile=/usr/local/koob/fireball/fireball.err.log 
stdout_logfile=/usr/local/koob/fireball/fireball.out.log 

回答