mercredi 17 janvier 2018

Supervisor not identifying Bash environment variables

I have an issue when using environment variable defined in .bash_profile. When I run this command :

sudo supervisord -c /etc/supervisord.conf.

It always return :

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

I am trying to set the user and absolute path of command from the environment variables. Config files :

1. supervisord.conf file:

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

[supervisord]
enviroment=nnsm3_root3=%(ENV_nnsms3_root)s,nnsm3_name=%(ENV_nnsm3_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_nnsm3_root)s/app/artisan queue:listen --tries=3  --queue=high,default,low
autostart=true
autorestart=true
user=%(ENV_nnsm3_name)s
numprocs=1
redirect_stderr=true
stderr_logfile=%(ENV_nnsm3_root)s/app/storage/logs/supervisor/processuserdata.err.log
stdout_logfile=%(ENV_nnsm3_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 nnsm3_root="/Users/JasemAl-sadi/Desktop/SMS/Local websites/nnsm3_main"
export nnsm3_user="Sony" 

I am running in macOS High Sierra with Mamp pro with PHP 7.1 with supervisor 3.3.3

**I saw most of the related issues, but nothing work :( **



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2DnIToc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire