Elastic Agent environment variables file

Hi all,

I'm not 100% sure where to submit a request to change so figured I would start here...

While installing elastic agent using the generic linux package I have battled for some time to get it to work with a web proxy, it turns out it doesn't pick up any pre-configured environment variables and relies on variables defined in the EnvironmentFile (but you need to look at the elastic-agent service config to find this, and for the life of me, I still can't find any documentation defining this...).

The elastic-agent services require any environment variables (such as proxies) to be added to /etc/sysconfig/elastic-agent, the directory /etc/sysconfig is not native to Debian-based OSs such as Ubuntu might I suggest a more generic location such as /etc/profile.d/elastic-agent as this is more generic and would be a recognised location on Redhat and Debian-based operating systems.

It just feels a bit odd to create a sysconfig directory on an ubuntu host just for this when the native location for this kind of info would be /etc/default/<config>

I appreciate it is difficult to cater for all, but this solution is very Redhat orientated and I feel there is a more generic solution for a generic linux package such as the one suggested above.

1 Like

What exactly do u mean it doesn't work with pre configured env vars? If u mean env vars that you've set for ur bash session, that's correct. When run as a service, it doesn't know about those vars and u must set them explicitly for the service. As for where and how, that will depend on the os.

ok, so fair enough the service doesn't work with variables preconfigured in /etc/bash.bashrc, but I think a generic linux package (which is the recommended installation package, not the deb or rpm package) should have a more generic location to store this data which is not tailored to a specific vendor layout.

Maybe this post was partially out of frustration (we have had a support ticket open which did not resolve this either, and to be fair we had to abandon due to other work taking priority, but this was not even hinted at), the lack of documentation on the topic is my biggest issue... I see a Github issue relating to proxy documentation is being worked on so fingers crossed that resolves many of the issues.

How are you creating the service? what does the service spec file look like?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.