Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash environment variables not identified in supervisord.conf #1045

Closed
Jasemalsadi opened this issue Jan 17, 2018 · 2 comments
Closed

Bash environment variables not identified in supervisord.conf #1045

Jasemalsadi opened this issue Jan 17, 2018 · 2 comments

Comments

@Jasemalsadi
Copy link

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. .

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

@Jasemalsadi
Copy link
Author

@mnaberez any help :)

@mnaberez
Copy link
Member

No shell is run when supervisord changes to a user. Since no shell is run, features like .bash_profile are not available. supervisord calls setuid() only. See Subprocess Environment for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants