Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shell commands, just do assignment expressions in /etc/environment file #9

Closed
flybyray opened this issue Jan 16, 2022 · 3 comments

Comments

@flybyray
Copy link

/etc/environment
This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line.
System-wide environment variables

line: "export VAULT_ADDR={{ vault_api_addr }}"

@robertdebock
Copy link
Owner

Ah, thanks.

So, I think you would like to see a key-value combination rather than export, something like this:

VAULT_ADDR={{ vault_api_addr }}

Regards,

Robert.

@flybyray
Copy link
Author

In short (or in most cases) yes.

It depends a little bit.

Start with code that barely works. That means some assumptions will be made.
https://robertdebock.nl/my-manifesto.html#simplicity
=> YES

Details:

The initial environment of the shell is populated in various
ways, such as definitions from /etc/environment that are
processed by pam_env(8) for all users at login time (on systems
that employ pam(8)).
https://man7.org/linux/man-pages/man7/environ.7.html

Second a file (/etc/environment by default) with simple KEY=VAL
pairs on separate lines will be read.
https://man7.org/linux/man-pages/man8/pam_env.8.html

The pam_env allows some overrides but I do not think someone will handle this on this level.

@robertdebock
Copy link
Owner

Hm, after reading a bit more, I think a location as /etc/profile.d/vault.sh is a better destination.

Thanks for pointing out /etc/environment is 'reserved' for different purposes.

I'll work on a commit for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants