From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Adding operating-system field for a custom /etc/profile. Date: Tue, 24 Nov 2015 23:03:43 +0300 Message-ID: <87ziy3qi5c.fsf@gmail.com> 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]:57332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Job-0001DD-G0 for guix-devel@gnu.org; Tue, 24 Nov 2015 15:03:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1JoY-0004ZO-9E for guix-devel@gnu.org; Tue, 24 Nov 2015 15:03:49 -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 =E5=AE=8B=E6=96=87=E6=AD=A6 (2015-11-24 18:22 +0300) wrote: > On 2015-11-24 04:07, Alex Kost wrote: >> This is a continuation of the discussion beginning here: >> . >> >> To sum up: I would like to have a possibility to use my own >> /etc/profile >> instead of the default one, but Ludovic doesn't want to provide me this >> freedom :-( > Well, every comment in /etc/profile came with a hack which make > something work. but it's becomming big and hard to understand every > line. Sorry, I don't understand what you want to say. I'm able to make my own /etc/profile based on the default one, and I just want to have an option to do it. >> Ludovic Court=C3=A8s (2015-11-23 17:31 +0300) wrote: >> >>> Hmm, I=E2=80=99m not sure if we want to give direct access to /etc/prof= ile >>> like >>> this. >> >> 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. Yes, unluckily GuixSD does not provide such control currently. [...] >>> The risk I see with adding a raw =E2=80=98profile-file=E2=80=99 option = is that >>> newcomers >>> may end up getting rid of such things without really noticing, and >>> then >>> getting a broken system. >> >> But a newcomer will learn about this option only if (s)he reads the >> manual with the warning I've mentioned. For me, your phrase sounds >> like: =C2=ABWe will not provide "rm" command, because a newcomer may >> accidentally run "rm -rf ~"=C2=BB. Please give me an opportunity to sho= ot >> myself in the foot! >> >> Besides will the system really be broken? What do you mean? Even if >> /etc/profile is empty, the system will boot successfully and a user >> could login, no? > Yes, login works, but then /run/current-system/profile/bin isn't in > PATH, and some system configurations (eg: locale, timezone) are ignored. Yes, but we are talking about an optional thing, that should be explicitly set by a user, so I don't really understand concerns about the potential risk, as a user will learn about this option at first before using it. >>> What about instead giving a way to populate the top and/or bottom of >>> this file? Controversial parts, if any, could still be turned on and >>> off by adding or removing services that add these lines? >> >> It is better than nothing, but it is not sufficient IMO. Any part of >> /etc/profile can be controversial (you'll never know what a user would >> like to change), so I think providing an option to change this file >> completely is essential. > 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? :-) I didn't know about /etc/environment. So IIUC it is used for VAR=3DVALUE pairs, right? If so and if it is supported by all shells (I don't see a mention of it in the bash manual though), I agree with you to move these things, great idea! > 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). IIUC invoking "guix package --search-paths" on both system and user profiles sets all required environment variables, so sourcing /run/current-system/profile/etc/profile and ~/.guix-profile/etc/profile is not needed, right? > 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? I agree that it's better to put plain VAR=3DVAL to /etc/environment. > and others may go into profile (eg: ASPELL_CONF, GST_PLUGIN_PATH). Yes. And this is another example of the thing I want to change: I don't like to have any mention of "$HOME/.guix-profile" in /etc/profile, so I would remove these things it if had a chance. > 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? I like the idea of separating /etc/environment and /etc/profile, but my main concern is to have a possibility to change /etc files the way I want, as I explained in the reply to Ludovic. --=20 Alex