加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

如何在程序部分中使用supervisord的环境选项?

发布时间:2020-12-13 18:14:39 所属栏目:Linux 来源:网络整理
导读:supervisord documentation表示 No shell is executed by supervisord when it runs a subprocess,so environment variables such as USER,PATH,HOME,SHELL,LOGNAME,etc. are not changed from their defaults or otherwise reassigned. (…) If you need to
supervisord documentation表示

No shell is executed by supervisord when it runs a subprocess,so
environment variables such as USER,PATH,HOME,SHELL,LOGNAME,etc.
are not changed from their defaults or otherwise reassigned. (…)
If you need to set environment variables for a
particular program that might otherwise be set by a shell invocation
for a particular user,you must do it explicitly within the
environment= program config option.

包含一个示例,我将其复制到/etc/supervisor/conf.d/apache2.conf中:

[program:apache2]
command=/home/chrism/bin/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND
user=chrism
environment=HOME=/home/chrism,USER=chrism

然而,

# supervisorctl reread
ERROR: CANT_REREAD: Unexpected end of key/value pairs

删除apache2配置的“环境”行不会导致重新读取的解析错误.这里有点什么?我在Debian Squeeze上使用supervisor 3.0a8-1并注意到主线主管是3.0a10;自3.0a8以来我找不到环境参考

解决方法

http://supervisord.org/configuration.html#program-x-section-settings

说“包含非字母数字字符的值应放在引号中”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读