#Environment variables missing

13 messages · Page 1 of 1 (latest)

dense tiger
#

Hello,
I am creating a pod with environment variables, but it doesn't seem to work. When I connect via SSH, and echo $ENV_VAR_NAME it prints nothing.
Am I missing something?
Also, printenv doesn't show the default environment variables from runpod, nor my added environment vars.
I am using my own template, but the Docker image is build on top of an official runpod image.

printenv
SHELL=/bin/bash
PWD=/
LOGNAME=root
MOTD_SHOWN=pam
HOME=/root
LS_COLORS=rs=0:di=01;34:ln=01;etc...
SSH_CONNECTION=xxxxx
TERM=xterm-256color
USER=root
SHLVL=1
LC_CTYPE=C.UTF-8
SSH_CLIENT= xxxxx
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
SSH_TTY=/dev/pts/0
OLDPWD=/workspace
TERM_PROGRAM=WarpTerminal
_=/usr/bin/printenv
sudden rover
#

try checking via web terminal if your key is there

sudden rover
dense tiger
dense tiger
#

Ah, you mean I should access them via a script that is ran automatically by CMD?
I will try that and let you know if it solves my issue.

sudden rover
sudden rover
#

printenv | awk -F = '{ print "export " $1 "="" $2 """ }' >> /etc/rp_environment
echo 'source /etc/rp_environment' >> ~/.bashrc

#

That helps automatically exporting all env variables

dense tiger
#

I added "env > saved_env_var.txt" in my start.sh file, and the txt file contains everything that was missing, so it should solve my issue.
Thank you very much!