Unable to set path in /etc/profile

Ed Cogburn edcogburn at hotpop.com
Sat Jul 23 20:49:58 UTC 2005


Lee Braiden wrote:

> On Saturday 23 July 2005 19:40, Irene Zimmermann wrote:
>> Appended the following as a root user:
>>
>> JDK_HOME=/usr/java/jdk
>> JRE_HOME=${JDK_HOME}/jre
>> JAVA_HOME=${JRE_HOME}
>> export JDK_HOME JRE_HOME JAVA_HOME
>> PATH=${JDK_HOME}/bin:${JRE_HOME}/bin:${PATH}
>> export PATH
>>
>> echo $PATH returns the original path after reboot.
>>
>> Help please.
> 
> I think you need to set the path in /etc/security/pam_env.conf


Either/or, but not really both (though it doesn't hurt).  The pam file is
for setting the base "environment" variables that *ALL* shells see, but
once picked up by the shell, it can still be overridden in the shell's own
normal startup scripts.

Also, note that the pam file can ONLY store *variables*, you can't stick
shell specific options in there like a bash "shopt" command for example. 
So if you want to change some of bash's default behavior, you'll still need
to use a shopt command in one of bash's startup scripts to do that, the pam
file can only hold simple variable=value pairs.

As for the PATH variable specifically, there is already a place for setting
that in /etc/login.defs with the advantage that you can declare 2 different
defaults, one for root, one for everyone else.  This config file existed
before pam, but pam is slowly taking over many of its old 'jobs' - pam is
now handling security in a uniform centralized manner that used to be
spread out in different programs like login).  But as above, it can still
be overridden later, so the OP first needs to check what is running *after*
his /etc/profile.







More information about the ubuntu-users mailing list