[英]Supervisord configured Environment variable in Java process
My java process takes a env variable "config". 我的Java进程使用一个env变量“ config”。 It works when I shoot the process from command line with "java -Dconfig=... ..."
当我使用“ java -Dconfig = ... ...”从命令行拍摄过程时,它可以工作
Now I have configured Supervisord and added the programs. 现在,我已经配置了Supervisord并添加了程序。 I also have added the below entry under supervisor tag in conf file
我还在conf文件的超级用户标签下添加了以下条目
environment=KEY="value",config="my path"
I think this value should be propagated to all child processes, hence my child java process should be able to access it with System.getProperty(). 我认为该值应该传播到所有子进程,因此我的子java进程应该能够使用System.getProperty()访问它。 But it is not getting any env variable with name "config".
但是,它没有获得任何名称为“ config”的env变量。
Any help :) 任何帮助:)
The environment
configuration parameter of Supervisord is for operating system (Linux) environment variables. Supervisord的
environment
配置参数用于操作系统(Linux)环境变量。 Parameters passed using -D
, on the other hand, are JVM options. 另一方面,使用
-D
传递的参数是JVM选项。 The correct way is to pass JVM options in command
. 正确的方法是在
command
传递JVM选项。
command=java -Dconfig=...
Don't forget quotes if a command argument contains spaces. 如果命令参数包含空格,请不要忘记引号。 See http://supervisord.org/configuration.html#program-x-section-values
参见http://supervisord.org/configuration.html#program-x-section-values
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.