只需要在/etc/supervisord/
文件夹下,找到程序的配置文件,如/etc/supervisord/superset.conf
在配置文件中增加一行
environment=SUPERSET_HOME=/home/qboxserver/.superset,SUPERSET_WEBSERVER_PORT=7070
多个环境变量用逗号隔开,就可以了,一个完整的配置文件如下
[program:superset]
command=python /etc/supervisord/qboxproxy.py -p /home/qboxserver/superset/_package/run/superset.pid -r /home/qboxserver/superset/_package/run/superset.log -c '/home/qboxserver/superset/venv/bin/python /home/qboxserver/superset/venv/bin/superset runserver'
directory=/home/qboxserver/superset/venv/bin/
priority=999
autostart=true
startsecs=1
autorestart=true
user=qboxserver
environment=SUPERSET_HOME=/home/qboxserver/.superset,SUPERSET_WEBSERVER_PORT=7070
保存配置,
然后执行
supervisorctl stop superset
supervisorctl remove superset
supervisorctl reread
supervisorctl add superset
即可生效