主管不识别Bash环境变量

时间:2018-01-17 18:17:31

标签: bash laravel laravel-5 supervisord supervisor

使用.bash_profile中定义的环境变量时遇到问题。当我运行此命令时:

sudo supervisord -c /etc/supervisord.conf.

总是回归:

format string '%(ENV_Jas_name)s' for 'program:laravel-process-user-data-queue.user' contains names ('ENV_Jas_name') which cannot be expanded.

我正在尝试从环境变量设置用户和命令的绝对路径。配置文件:

1。 supervisord.conf文件:

[unix_http_server]
file=/tmp/supervisor.sock   ; the path to the socket file

[supervisord]
enviroment=Jas_root3=%(ENV_nnsms3_root)s,Jas_name=%(ENV_Jas_name$)
logfile=/tmp/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB        ; max main logfile bytes b4 rotation; default 50MB
logfile_backups=10           ; # of main logfile backups; 0 means none, default 10
loglevel=info                ; log level; default info; others: debug,warn,trace
pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=false               ; start in foreground if true; default false
minfds=1024                  ; min. avail startup file descriptors; default 1024
minprocs=200                 ; min. avail process descriptors;default 200

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:laravel-process-user-data-queue]
process_name=%(program_name)s_%(process_num)02d
command=sudo php %(ENV_Jas_root)s/app/artisan queue:listen --tries=3  --queue=high,default,low
autostart=true
autorestart=true
user=%(ENV_Jas_name)s
numprocs=1
redirect_stderr=true
stderr_logfile=%(ENV_Jas_root)s/app/storage/logs/supervisor/processuserdata.err.log
stdout_logfile=%(ENV_Jas_root)s/app/storage/logs/supervisor/processuserdata.out.log

2。 .Bash_profile:

source ~/.profile
export PATH=/Applications/MAMP/bin/php/php7.0.19/bin:$PATH
export PATH="/usr/local/sbin:$PATH"
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
export Jas_root="/Users/JasemAl-sadi/Desktop/SMS/Local websites/Jas_main"
export Jas_user="Sony" 

我在Mac OS High Sierra中使用PHP 7.1与主管3.3.3运行

**我看到了大部分相关问题,但没有任何效果:( **

0 个答案:

没有答案