From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: /etc/environment and /etc/profile Date: Fri, 27 Nov 2015 15:34:51 +0100 Message-ID: <87bnaf8q9g.fsf_-_@gnu.org> References: <877ftschjt.fsf@gmail.com> <87fv8fip01.fsf@gnu.org> <87d23j1bxk.fsf@gmail.com> <871tjyfnl8.fsf@gnu.org> <876199q4z1.fsf@gmail.com> <87ioca4ojo.fsf@gnu.org> <87lh9tvcws.fsf@gnu.org> <87h9kguwc4.fsf@gmail.com> <87ziy7d90z.fsf@gnu.org> <874mgfkxee.fsf@gmail.com> <87wptb5d1y.fsf@gnu.org> <87r3jisc76.fsf@gmail.com> <87lh9q1f2i.fsf@gnu.org> <877fl9q3gv.fsf@gmail.com> <87h9kdy6ty.fsf@gnu.org> <871tbh53rt.fsf@gmail.com> <87vb8sss7j.fsf@gnu.org> <87y4doscmg.fsf_-_@gmail.com> <3fa07a3d615d80be9fb10da9e026ae48@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2K71-0002Ns-Hb for guix-devel@gnu.org; Fri, 27 Nov 2015 09:35:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2K6w-0003Pm-E0 for guix-devel@gnu.org; Fri, 27 Nov 2015 09:34:59 -0500 In-Reply-To: <3fa07a3d615d80be9fb10da9e026ae48@openmailbox.org> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Tue, 24 Nov 2015 23:22:17 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel@gnu.org, Alex Kost =E5=AE=8B=E6=96=87=E6=AD=A6 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=E2=80=99s fine to let that one be completely overridden. = The documentation would have to clearly explain what the default file contains, and what=E2=80=99s 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=E2=80=99m also happy if you or so= meone else gives it a try. Thanks for your very clear analysis! Ludo=E2=80=99.