【问题标题】:export environment variables for supervisord nobody user为 supervisord 没有人用户导出环境变量
【发布时间】:2019-12-27 18:41:00
【问题描述】:

我使用 supervisord 来运行像 celery 这样的应用程序。

我使用nobody 用户来运行这些应用程序。但他们找不到环境变量。

例如,这是我使用nobody 用户的celery.conf。当我用 supervisord 运行 celery 时,它找不到我之前设置的 DJANGO_SETTINGS_MODULE 环境变量。

; ==================================                                                    
;  celery worker supervisor                                                             
; ==================================                                                    

[program:celery]                                                                        
command=/home/ubuntu/pl_env/bin/celery worker -A config --loglevel=INFO                 
directory=/home/ubuntu/petroline_django                                                 

user=nobody                                                                             
numprocs=1                                                                              
stdout_logfile=/var/log/celery/worker.log                                               
stderr_logfile=/var/log/celery/worker.log                                               
autostart=true                                                                          
autorestart=true                                                                        
startsecs=10                                                                            

; Need to wait for currently executing tasks to finish at shutdown.                     
; Increase this if you have very long running tasks.                                    
stopwaitsecs = 600                                                                      

; Causes supervisor to send the termination signal (SIGTERM) to the whole process group.
stopasgroup=true                                                                        

; Set Celery priority higher than default (999)                                         
; so, if rabbitmq is supervised, it will start first.                                   
priority=1000     

【问题讨论】:

    标签: ubuntu supervisord


    【解决方案1】:

    我在supervisord configuration file中找到了environment设置,可以用来解决这个问题。

    【讨论】:

      猜你喜欢
      • 2016-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-18
      • 2014-08-05
      • 2012-06-08
      • 2015-04-09
      • 1970-01-01
      相关资源
      最近更新 更多