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

前端之家收集整理的这篇文章主要介绍了如何在程序部分中使用supervisord的环境选项?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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

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

猜你在找的Linux相关文章