如何将环境变量从.env文件传递给超级用户

时间:2019-07-01 09:31:01

标签: python django environment-variables supervisord

我在/home/home/ubuntu/orlando.env中有一个.env文件 我在/etc/supervisor/conf.d/orlando_celerybeat.conf中有一个.conf文件 我想将.env中的所有环境变量传递给orlando_celerybeat.conf。我该怎么办

我可以通过使用.conf文件中的(environment = my_environment = TEST)轻松传递单个变量,但我想通过文件


; the name of your supervisord program
[program:orlandocelery]
environment=my_environment=TEST

; Set full path to celery program if using virtualenv
command=/home/ubuntu/envs/bin/celery worker -A orlando --loglevel=INFO

; The directory to your Django project
directory=/home/ubuntu/orlando

; If supervisord is run as the root user, switch users to this UNIX user account
; before doing any processing.
user=ubuntu

; Supervisor will start as many instances of this program as named by numprocs
numprocs=1

; Put process stdout output in this file
stdout_logfile=/var/log/celery/orlando_worker.log

; Put process stderr output in this file
stderr_logfile=/var/log/celery/orlando_worker.log

; If true, this program will start automatically when supervisord is started
autostart=true

; May be one of false, unexpected, or true. If false, the process will never
; be autorestarted. If unexpected, the process will be restart when the program
; exits with an exit code that is not one of the exit codes associated with this
; process’ configuration (see exitcodes). If true, the process will be
; unconditionally restarted when it exits, without regard to its exit code.
autorestart=true

; The total number of seconds which the program needs to stay running after
; a startup to consider the start successful.
startsecs=10

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

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

; if your broker is supervised, set its priority higher
; so it starts first
priority=998

0 个答案:

没有答案