[Exherbo-dev] ROOTPATH, pam_env and profile.env
sardemff7 at exherbo.org
Wed Feb 6 20:50:24 UTC 2013
Let’s start with the easy part.
I’m going to drop ROOTPATH and use
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin for everyone.
Every Exherbo user is highly likely to be a super user, so there is no
real point to keep her from using sbin stuff.
To achieve that, I will add the full PATH to /etc/env.d/00basic, and
simply drop the redefinitions in /etc/profile and other shells
equivalent files (e.g. zprofile).
Now that we have a clean environment, let’s use it correctly.
Using profile.env assumes everything will launch a shell to set the
environment up. This is wrong. DMs parse or source sometimes
/etc/profile to get the basic env, but more rarely the user files. It
depends on the distribution sessions scripts too. It’s messy to work
with. Tools like weston-launch (to launch Weston from a TTY) simply
clean the environment, then launch the compositor: no way to get
The solution is to use PAM, which is common to all these, even the TTY
login. pam_env module have been around for ages, but not used in the
I will push some basic change to the eclectic env module to keep the
simple KEY=VALUE file around, without the export used in profile.env.
So, here is the status after these two changes:
— No more ROOTPATH, and a full usable PATH with all the tools you need
— The environment is set correctly when using PAM (TTY login, DMs,
weston-launch) with all package-specifics vars
Now, the tricky part.
With the pam_env usage, profile.env becomes obsolete. The full
environment is here, for every session.
Keeping it around makes shells a bit slower, with no benefit since the
work is done already.
Is there any reason to keep profile.env around then? (Same question for
I would push the first two changes in a week if nobody objects in the
meantime, and the third one in about a month.
Quentin “Sardem FF7” Glidic
More information about the Exherbo-dev