Questions tagged [environment-variables]

Environment variables are configuration options that can be set in a shell or other similar environments. All programs started from within the shell can read them and configure themselves.

Environment variables are key-value-pair configuration options like KEY=valueor FOO=bar. Environment variables allow you to configure a program before it gets executed and without the need to store these variables in proprietary configuration files.

They are present on all POSIX systems (Unix, Linux, BSD, Mac OS, DOS, Windows, ...). Environment variables can be set by any shell and read by nearly any programming language.

Some programming languages allow you to set Environment variables, but they only persist within the current process. You can't set them to be visible by the calling shell. So they are not useful for inter-process communication.

410 questions
0
votes
1 answer

How to pass environment variables with FreeBSD service command?

The rc.subr ${name}_env specifies this for setting environment variable: ${name}_env A list of environment variables to run command with. This will be passed as arguments to env(1) utility. So I tried using it like…
0
votes
1 answer

Getting command not found using sudo, but not for running command as root without sudo

wierd issue where if you use sudo command for certain commands it is not found. But runnning it as root user WITHOUT sudo does work root@ip-172-31-43-153:/home/ubuntu# sudo xfs_growfs -d / sudo: xfs_growfs: command not…
user2958456
  • 101
  • 1
0
votes
0 answers

Gunicorn can't access a .ini file containing credentials to parse in Django's settings.py Debian+Nginx+Gunicorn+Django

today I spent hours trying to use Environment Variables in Debian for a Python project. I tried exporting them in various files: /home/user/.profile /home/user/.bashrc /etc/environment /etc/profile /etc/profile.d/ /root/.profile /root/.bashrc I…
0
votes
1 answer

Erased System Path Variables

I was writing a batch file that was supposed to automatically set up a computer to receive "psexec" remote commads. Unluckly i didn't really pay attention to what i was writing and i wrote this command and then ran It: setx /M Path…
0
votes
1 answer

crontab: using ${USER}

I am writing some scripts that uses ${USER} to point to subsequent scripts. But when I run it from crontab, it errors out and the files are not found. I understand why. I intend to share this with my colleagues and each time the colleague has to…
SEU
  • 101
0
votes
1 answer

Technically how do curl, ping and other tools get around an NGINX front facing reverse proxy server?

I'm having trouble understanding how communication occurs on a linux box if a front facing server like NGINX has been installed. For example this is my setup. AWS / EC2 linux based instance NGINX - front facing server Node.js / Express - upstream…
myNewAccount
  • 569
  • 1
  • 6
  • 19
0
votes
0 answers

http_proxy lists port of 3128 but when I netstat that port is not open. What does this indicate?

My proxy values suggest that localhost:3128 is being used as a proxy. I should add that I personally added these environmental variables in an .sh file in my profile.d folder. A tutorial indicated I needed to do this to enable a particular Google…
myNewAccount
  • 569
  • 1
  • 6
  • 19
0
votes
1 answer

On CentOS 8 in profile.d do I need to add my script related to environment variables to both an .sh and .csh file?

I need to add environmental variables related to proxy servers to allow my node.js app to communicate with reCAPTCHA Enterprise on Google Cloud. When I run the scripts from Accessing Google Cloud APIs though a Proxy communication with Google Cloud…
myNewAccount
  • 569
  • 1
  • 6
  • 19
0
votes
0 answers

no login/no home dir user gets permission for denied (redhat8)

I am trying to solve a problem At work there is a given task where a python application is currently running on a server, this application is using a env file, which has username and password information. The current ask is to hide the username and…
vector8188
  • 111
  • 1
  • 6
0
votes
1 answer

java.exe in "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe" overridden local Java installation

Why and how come java.exe appeared in "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe", on Windows 10, and even more surprisingly - overridden my OpenJDK's java.exe binary, out of a sudden, which I have as an explicit System…
0
votes
1 answer

Setting environment variable for a different user in windows

There are tons of examples on the web how to set an environment variable for the current user. Is it possible to set an environment variable in windows for a different user (that does not have login rights?)
arthur
  • 177
  • 2
  • 8
0
votes
1 answer

Python throws KeyError when exporting environment variables

I have a weird case where i have a secret.env file where i set all my environment variables as such: secret.env export TWITTER_CONSUMER_KEY="something" export TWITTER_CONSUMER_SECRET="something" Then i built a docker file to export all the…
0
votes
2 answers

gammu 1.42, gammu-smsd service error, LD_LIBRARY_PATH not found

I'm trying install Gammu 1.42 to serve my SMS gateway on Centos 8. make, make test, make install works fine. LD_LIBRARY_PATH configured in /etc/profile as: ...... LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:.:/usr/local/lib64 export PATH USER…
cidy.long
  • 101
  • 3
0
votes
0 answers

Process getting different environment variables to system settings

I have an issue where a tomcat process started through salt stack is getting different environment variables than the ones set on the system. This is on a centos 7 server. Below is the locale -v settings i get when i run the command on the server…
a.smith
  • 111
  • 1
  • 4
0
votes
0 answers

How can I add a library search path to an executable running with a capability?

I have an application that needs to run with the CAP_NET_BIND_SERVICE capability so that it can open a low port (502 for a TCP/Modbus server). It comes bundled with a set of .so files that it needs to dynamically link against, including pinned…