[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Structure of /etc/profile

With the discussion going on in another thread about what to put in 
/etc/profile by default, whether to allow packages to add to it, and so 
on, I thought it was time to bring this idea up.

/etc/profile is normally used to do two things - set a default 
process environment for users while logging in (environment variables, 
umask, ulimit, and so on) and do other things the administrator wants it 
to do, like running fortune, displaying messages, etc.

I think that these two functions are logically separate, and I suggest 
that they be separated. I propose that a file /etc/environment is used to 
set the process environment. This would be sourced by /etc/profile. It 
would also be sourced by the system Xsession script.

This removes one of the major X administration hassles, that of keeping X
session environments in step with normal login ones.  (Some people source
/etc/profile from Xsession, but this isn't a good thing for a distribution
to do because some things in /etc/profile may depend on having a
controlling tty.)

/etc/environment would have to be idempotent, but this shouldn't be hard 
to achieve.

Steve Early

Reply to: