Skip to main content

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.

0 votes
1 answer
87 views

How do I configure registry values for a Windows service configured as a generic service in a Windows Server Failover Cluster?

I have a Windows service on two nodes of a Windows Server Failover Cluster, configured as a generic service for high availability. On the nodes I installed a monitoring software which stores ...
Morfhine's user avatar
0 votes
1 answer
66 views

sshd setting `AcceptEnv HOME` doesn't seem to work

I ssh into a running Docker container. This container has mounted home directory (/home/username) to an NFS partition, shared between several users of other similar containers. All these containers ...
wl2776's user avatar
  • 181
0 votes
1 answer
244 views

Why does podman have secrets?

What is the difference between storing secrets as a podman secret and storing them in an environment file? In what way is the secret more secure, if at all? In other words, podman secret create ...
nigel222's user avatar
  • 151
0 votes
0 answers
25 views

How to assign different environmental variables for different MPI processes?

Recently I have been thinking of a way to explicitly setup different environmental variables for different MPI processes. My case is to profile my own parallel CUDA code (using nsys) on my server. I ...
Hiroshi's user avatar
0 votes
1 answer
96 views

Windows Ghost Environment variable

I am having an issue with Windows 10 environment variables. I was attempting to perform an Oracle XE installation which failed and then rolled back. My issue now is that the ORACLE_HOME env variable ...
parakmiakos's user avatar
0 votes
0 answers
65 views

Forward Kubernetes configmap environment variables to pod internal SSH server

I have created a pod using RHEL9 ubi9-init image. I added envFrom term in the K8s yaml file for the pod that imports environment variables from the K8s configmap. The running pod /proc/1/environ has ...
xis19's user avatar
  • 101
0 votes
0 answers
58 views

Conditionally set a variable if Windows environment variable doesn't exist

I'm using Apache Webserver 2.4.63 for Windows. I need to conditionally set some variables depending on whether a Windows OS environment variable exists or not. I currently have a httpd.conf file which ...
DecentWig's user avatar
0 votes
0 answers
468 views

LD_LIBRARY_PATH ignored for Qt6 application

I'm trying to deploy a Qt6 application on a Ubuntu 24.04 machine. Here my dist content: . ├── libQt6Core.so ├── libQt6Core.so.6 ├── libQt6Core.so.6.8.0 ├── libQt6Gui.so ├── libQt6Gui.so.6 ├── ...
Mark's user avatar
  • 185
1 vote
0 answers
504 views

How to securely replace .env file with HashiCorp Vault Secrets in PHP?

I'm looking to securely replace the use of a local .env file in my PHP script with HashiCorp Vault Secrets. Here’s how my current code loads environment variables from .env: $envFile = __DIR__ . '/../....
MultiformeIngegno's user avatar
0 votes
1 answer
161 views

Specify environment variables for grafana-a-deployment in grafana-a CR with Grafana Operator in OpenShift

With the community-provided Grafana Operator in OpenShift, how can we configure the Custom Resource (CR) grafana-a to pass environment variables (e.g. NO_PROXY and HTTPS_PROXY) to the Deployment ...
wwillfred's user avatar
1 vote
1 answer
93 views

Executing a list of commands on distinct lines with bash -c?

I pass a list of commands to a bash script through an environment variable as shown in the example below: CMDS=' date > date.txt cat date.txt date | rev ' script What is the correct ...
chmike's user avatar
  • 458
0 votes
1 answer
1k views

host not found in "$server_listen_port" of the "listen" directive

With the following nginx config excerpt: map $server_name $server_listen_port { default 443; localhost. 80; localhost 80; } server { server_name "${ENVIRONMENT_SERVER_NAME}.&...
Mr. Developerdude's user avatar
3 votes
1 answer
3k views

sourcing environment variable in bashrc: directly vs export from file yields different result - why

I am running systemd via user (i.e. enable-linger $USER) and I interact with services via systemctl --user I noticed a strange issue. Sourcing Type 1 In order for the above systemd to work for a user, ...
Newskooler's user avatar
0 votes
0 answers
225 views

I cannot get environment variable from apache

On a Centos 8, I added a SetEnv into my VirtualHost conf: <VirtualHost *:XXXX> Alias /static/ /opt/industrialisation/xxxx/xxxx/xxxx/ <Directory /opt/industrialisation/xxx/xxxx/> ...
timothepoznanski's user avatar
2 votes
1 answer
6k views

How does Windows set the %SystemRoot% variable?

The %SystemRoot% environment variable contains the path to the Windows directory. (e.g. c:\windows) SystemRoot is not configured in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ...
Martin's user avatar
  • 619
0 votes
1 answer
541 views

PHP exec(iptables --help) works but exec(iptables --command) doesn't work

In PHP 7.3.33 and Apache 2.4 I want to run iptables from PHP (web server enviroment) in order to block/unblock IPs, from command line, this works fine: /usr/sbin/iptables --insert INPUT --source ...
adrianTNT's user avatar
  • 1,262
3 votes
2 answers
3k views

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 ...
Rahul Bharadwaj's user avatar
1 vote
1 answer
3k views

Why environment variable set by SetEnv in apache httpd.conf cannot be passed to php?

I set an environment variable in httpd.conf: SetEnv http_proxy "http://localhost:3128" But I cannot get this variable in php using getenv: <?php echo getenv("http_proxy"); ...
peter's user avatar
  • 143
0 votes
1 answer
512 views

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: ...
user2958456's user avatar
3 votes
1 answer
15k views

How to create .env multiline variable

The title may be a bit confusing, so a little explanation. I need to configure an application by passing a PKCS1 PEM encoded key using environment variable. The App is configured using a .env file ...
Krystian's user avatar
  • 326
2 votes
1 answer
2k views

/etc/environment.d does not take effect on Archlinux

I believe systemd-environment-d-generator parses conf files under /etc/environment.d/. cat /etc/environment.d/60-foo.conf FOO=xxx But even after reboot, the environment variable 'FOO' does not ...
takaomag's user avatar
  • 261
1 vote
1 answer
2k views

Condition depending on domain in .htaccess: SetEnvIf and IfDefine?

I would like to add a rule in .htaccess that "Does something" (actually enable a httpauth user restriction) depending on the domain name. I thought I had it and did: <IfModule ...
Urs's user avatar
  • 115
1 vote
1 answer
481 views

How to set a proxy for terminal without exporting the environment variable?

How to set a proxy for terminal without exporting the environment variable? I am using a Ubuntu machine and I would like to do that? If it not possible, are there any apps to help me do that? Thank ...
1n4ho12's user avatar
  • 13
3 votes
1 answer
7k views

Environment variables in systemd ExecStart, ExecStop clauses not working as expected

I'm working on some unit files for some systemd services. The path prefix to some of my binaries is quite long and they are used several times in ExecStart=, ExecStartPost=, and ExecStop= clauses. I ...
Windscale's user avatar
0 votes
1 answer
1k views

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 ...
Xcode's user avatar
  • 1
1 vote
1 answer
462 views

Avoid pod environment variables' conflicts with Docker-style links

We running or components in Kubernetes with Docker as container runtime. A problem with it is that pod environment is polluted with Docker-style link variables like SERVICENAME_PORT_8181_TCP ...
Petr Gladkikh's user avatar
0 votes
1 answer
457 views

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 ...
SEU's user avatar
  • 101
0 votes
1 answer
2k views

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 - ...
myNewAccount's user avatar
0 votes
0 answers
4k views

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 ...
myNewAccount's user avatar
0 votes
1 answer
526 views

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 ...
myNewAccount's user avatar
0 votes
0 answers
540 views

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 ...
vector8188's user avatar
0 votes
1 answer
13k views

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,...
Giorgi Tsiklauri's user avatar
1 vote
2 answers
798 views

How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib?

How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib? I have tried setting LD_LIBRARY_PATH to each of the program names like ...
user avatar
1 vote
1 answer
7k views

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 ...
arthur's user avatar
  • 187
1 vote
1 answer
3k views

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="...
Mervin Hemaraju's user avatar
2 votes
3 answers
4k views

Using ENV variables in Postfix and Dovecot configuration files

I'm trying to dockerize my mailing server and I'm having some troubles regarding how am I supposed to use environment variables inside Postfix and Dovecot configuration files (I'm using the latest ...
Jose's user avatar
  • 29
0 votes
2 answers
1k views

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/...
cidy.long's user avatar
  • 103
1 vote
1 answer
860 views

NUMBER_OF_PROCESSORS env var incorrect on Dell PowerEdge Gen14 With Windows Server 2012 R2

I'm seeing that the environment variable NUMBER_OF_PROCESSORS is incorrect on my newly installed Dell PowerEdge 740xd Gen 14 running Windows Server 2012 R2 Standard. The machine contains 2 CPUs - ...
sevzas's user avatar
  • 233
0 votes
0 answers
252 views

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 ...
a.smith's user avatar
  • 111
2 votes
0 answers
3k views

Apache 2.4 environment variables in config

Ok, so I'm building a docker image for apache. I want to allow users to specify custom apache config with the environment variable. TL;DR The question could be simplified to this: how to use ...
pavel.sheiman's user avatar
1 vote
0 answers
130 views

Environment variables inside of an environment file

Background I was deploying my docker environment to a production server when I've noticed that the application would not work. For some reason the environment variables were not set correctly inside ...
Kolyunya's user avatar
  • 237
1 vote
1 answer
2k views

Can the Apache SetEnvIf Request_URI variable be decoded in Virtual Host and/or Server config context?

When the following SetEnvIf directive is in a virtual host directory section or in an .htaccess file the Request_URI variable is percent decoded. But when it is not in a directory section or .htaccess ...
NOYB's user avatar
  • 201
0 votes
0 answers
797 views

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 ...
user583054's user avatar
0 votes
2 answers
963 views

How to set a tmp env variable from inside a bash script

I have a simple bash script: #!/bin/bash export MONGOMS_DOWNLOAD_URL="https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz" export MONGOMS_VERSION="4.2.8" ...
John's user avatar
  • 927
0 votes
1 answer
157 views

How do I set enviromental varialbes for my ubuntu server?

I have a ubuntu server deployed at digitalocean with gunicorn and nginx to host my django project. Now I want to save my secret key in an env. var. . I searched in the internet and I found that I have ...
Sven's user avatar
  • 135
3 votes
1 answer
6k views

Using IfDefine with environment variables

I am trying to make my configuration as flexible and easy-to-configure as possible by using a list of variables in /etc/sysconfig and loading the environment variables when Apache is started using a ...
triskit's user avatar
  • 223
-1 votes
1 answer
754 views

How can I fix the error Undefined variable: _ENV in /home/nginx/domains/mydomain.com/system/Config/BaseConfig.php?

I am trying to install a Codeigniter application in pure NGINX + PHP-FPM environment but it was previously developed in apache . After adding all the proper rules to Nginx in order to work with ...
Optimus Servers's user avatar
0 votes
1 answer
11k views

How to interpolate Jenkins environment variables inside Dockerfile?

I have a Jenkins pipeline, One of the stages of the pipeline is to build the artifact from a java application code. The artifact always get the name hello-world-${BUILD_ID}.war using BUILD_ID jenkins ...
Sara Ben Shabbat's user avatar
1 vote
1 answer
1k views

linux capabilities to read environment variables?

I'd like to run a service as a non-privileged user, but it needs to bind to a system port number (i.e. less than 1024), so I give it setcap 'cap_net_bind_service=+ep' <path for service>, all ...
code9016's user avatar
2 votes
0 answers
211 views

How to auto init direnv on Google Cloud Shell?

my .bashrc has these lines at the bottom: if [ -f $HOME/tools/bashrc ]; then source $HOME/tools/bashrc fi and $HOME/tools/bashrc has this code at the bottom: eval "$(pyenv init -)" pyenv ...
Noel Pure's user avatar
  • 121

1
2 3 4 5
9