I'd like to reference the hostname in an environment snippet. Is this possible? I tried:
However FOO results in the same string as above, without executing the hostname command
Replying to my own post, it appears the contents of the snippet value for environment variables is enclosed in single quotes. That's why the backtick command execution is not happening. So the question is - is there anyway to have dynamic values in enironment settings? For example, reference another environment variable, or use ` or $(...)
The real issue here is that CM writes all the environment variables you specify (and others determined internally) to a supervisor.conf file for that process. The supervisord process then starts the process using supervisor.conf variables.
This means that it is the supervisord that needs to know how to set environment variables dynamically and I don't think that is a feature supported in supervisord at this time.
Depending on what you are trying to accomplish, there may be other ways to do this without environment variables.
Thanks for the response. I'm just trying to pass in a -D property to a HDFS process that includes the actual hostname of the server it's running on. Is there a way to make changes to HDFS startup scripts without breaking CM?
There is no option to dynamically set options. Please explain what parameter you want to set explicitly to what value, and why this is needed.