~/.profile vs ~/.pam_environment

Jonathan Marsden jmarsden at fastmail.fm
Fri Jun 14 18:43:06 UTC 2013


On Fri, Jun 14, 2013, at 05:15 AM, Lars Nooden wrote:

> On Thu, 13 Jun 2013, Jonathan Marsden wrote:

>> What specifically makes you think changes to /etc/environment "do not
>> have any effect" in Lubuntu Saucy?  Can you provide a complete set of
>> "steps to reproduce", please?  Make sure you log all the way out, or
>> reboot, after making a change to it.

> I tried changing them yesterday and must have done something wrong.
> Today I tried the same method and /etc/environment takes effect if
> there is no .profile.  I do notice though that /etc/skel has .profile
> instead of .pam_environment.  Should that be changed?

No.  Why?  .pam_environment is not the same thing as .profile.  There is
no "instead of" relationship between them.  I don't understand why you
think there is.  /etc/environment (and ~/.pam_environment) will be used
(via PAM) whether or not .profile exists for the user concerned.  One is
executed by PAM, one is executed by a login shell.

If you configure things so both /etc/environment *and* ~/.profile affect
the same variable, then ~/.profile is likely to "win", because (as far
as I know) it is executed later than /etc/environment.  I would try to
avoid relying on that ordering, though.

What you are describing about "/etc/environment takes effect if
there is no .profile" is not how things are supposed to work.

If you have a situation where the existence of a file ~/.profile
suppresses the use of ~/.pam_environment at login, I need a clear
description of "steps to reproduce" so I can look into it...

Jonathan
-- 
  Jonathan Marsden
  jmarsden at fastmail.fm




More information about the Lubuntu-users mailing list