Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 5055  / 2 Years ago, thu, january 6, 2022, 3:32:42

Running Ubuntu 13.04, I'm trying to add variables to PATH for the session, which is recommended to do inside .pam_environment, but nothing seems to work. Here's what it looks like:



JAVA_HOME          DEFAULT=/usr/lib/jvm/java-7-oracle
IDEA_HOME DEFAULT=/usr/local/idea-IU-129.451/bin
LIGHTTABLE_HOME DEFAULT=/usr/local/LightTable
CLOUDIFY_HOME DEFAULT=/home/eliranm/builds/gigaspaces-cloudify
PATH DEFAULT=${PATH} OVERRIDE=${PATH}:${JAVA_HOME}:${IDEA_HOME}:${LIGHTTABLE_HOME}:${CLOUDIFY_HOME}


It seems all variables are set but the PATH, or that it is overridden somehow. I tried to prepend or append the ${PATH} variable, to use DEFAULT only, OVERRIDE only, tried to just set a hard-coded path as a value, all to no avail.



I'm following the recommendations from the Ubuntu help community, and I want to avoid concatenating hard-coded paths to the PATH inside /etc/environment as it's not the right scope, plus, it will be hard to maintain with no variables.



Others may be affected by this issue, as stated here, but no one provided a solution so far.



How to make this work?


More From » 13.04

 Answers
3

I think that using $PATH variable inside the scope of /etc/environment or ~/.pam_environment does not get resolved, but assigned just as is literally.



In fact I see using $PATH or any variable inside ~/.pam_environment being discouraged on most post I read like here: Why doesn't my environment variable get set.



So I don't really know why here (Session-wide environment variables) they tell to use $PATH in it.



I know that Debian removed the parsing of the local ~/.pam_environment as it is a high security risk.



Anyway for my understanding the two files /etc/environment and ~/.pam_environment use a simpler syntax (simple KEY=VAL pairs for each line) then /etc/security/pam_env.conf (VARIABLE [DEFAULT=[value]] [OVERRIDE=[value]]). So perhaps no reference to variable can be made at all inside them.


[#30840] Thursday, January 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eighethod

Total Points: 358
Total Questions: 112
Total Answers: 119

Location: Cayman Islands
Member since Fri, Mar 4, 2022
2 Years ago
;