[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
/etc/environment and /etc/profile
From: |
Ludovic Courtès |
Subject: |
/etc/environment and /etc/profile |
Date: |
Fri, 27 Nov 2015 15:34:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
宋文武 <address@hidden> skribis:
> On 2015-11-24 04:07, Alex Kost wrote:
[...]
>> Oh, no! If there is one person (me) who wants to have a full
>> control on
>> his /etc/profile, there may be the others with the same wish.
> Sure, I think we all want (and should have) a full control.
Agreed.
> To be clear, /etc/profile contains 3 parts:
>
> 1. variables from configuration of the operating-system (LANG, TZ,
> etc.)
> 2. environment setup for system and user profiles
> (source .guix-profile/etc/profile)
> 3. hacks for making sensible defaults (LINUX_MODULE_DIRECTORY,
> ASPELL_CONF, etc).
>
> And it's only effective for POSIX login shells (bash and zsh).
>
> For 1, maybe the most important one, it's already managed, but doesn't
> work for fish and rc. We need to move these into /etc/environment,
> which work for all shells (even emacs? :-)
Using /etc/environment sounds like a good idea! IIUC, it requires using
pam_env, right? Do you know exactly what it would take?
> For 2, we had build a etc/profile file for each profile's search-paths,
> here source both system and user to make most things work
> out-of-the-box.
>
> I think this is the real purpose for our /etc/profile.
> Technical, if we remove those, the result system will be the same as
> guix on foreign distros. So, it's ok to completely replace it.
>
> (some variables (eg: MANPATH, INFOPATH, XDG_DATA_DIRS) can be set in
> each profile, and mergerd well).
Yeah, I assume it’s fine to let that one be completely overridden. The
documentation would have to clearly explain what the default file
contains, and what’s at stake if you remove it.
> And 3, IMO is the controversial parts.
>
> the one don't related to profiles can go into /etc/environment
> (eg: LINUX_MODULE_DIRECTORY, SSL_CERT_DIR, DBUS_FATAL_WARNINGS),
> these need to be addressing by adding services?
>
> and others may go into profile (eg: ASPELL_CONF, GST_PLUGIN_PATH).
Yes.
> So, the plan is add /etc/environment and only use /etc/profile for 2.
> then, a sh-profile file-like configuration can be added. WDYT?
Sounds like a reasonable plan to me.
I can start work in that direction, but I’m also happy if you or someone
else gives it a try.
Thanks for your very clear analysis!
Ludo’.
Re: Adding operating-system field for a custom /etc/profile., 宋文武, 2015/11/24
/etc/environment and /etc/profile,
Ludovic Courtès <=