From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Adding operating-system field for a custom /etc/profile. Date: Mon, 23 Nov 2015 23:07:51 +0300 Message-ID: <87y4doscmg.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> 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]:38778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0xP5-0002gs-Ew for guix-devel@gnu.org; Mon, 23 Nov 2015 15:08:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0xP0-0004CA-ET for guix-devel@gnu.org; Mon, 23 Nov 2015 15:07:59 -0500 In-Reply-To: <87vb8sss7j.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 23 Nov 2015 15:31:12 +0100") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org 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 :-( Ludovic Court=C3=A8s (2015-11-23 17:31 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2015-11-23 02:04 +0300) wrote: >> >>> Alex Kost skribis: [...] >>>> =E2=80=A6 what I suggest now is just to give an option to avoid genera= ting the >>>> default /etc/profile. What about making an 'operating-system' field f= or >>>> this file (similar to 'sudoers-file' or 'hosts-file')? So when such >>>> 'profile-file' is specified, it will be used instead of the default one >>>> (of course, it should be mentioned in the manual that it's only for >>>> those users who are sure what they do). >>> >>> I think we could make an /etc/profile-service that receives snippets >>> meant to be glued together into the final /etc/profile. Users could >>> specify the top or bottom of the file. >>> >>> There could be a combined-search-paths-service that implements the >>> solution I proposed here. >>> >>> WDYT? >> >> I agree, the more ways to change a default behaviour, the better. >> Although I will not use these things if there will be =E2=80=98profile-f= ile=E2=80=99 >> field that allows to specify my own "/etc/profile". > > [...] > >> Great! So is it OK to send a patch for adding =E2=80=98profile-file=E2= =80=99 field? > > Hmm, I=E2=80=99m not sure if we want to give direct access to /etc/profil= e 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. > The problem is that several things in there are here to make the system > work, and to to make it conform to the =E2=80=98operating-system=E2=80=99= declaration, > such as: > > > export LANG=3D"en_US.utf8" > export TZ=3D"Europe/Paris" > export TZDIR=3D"/gnu/store/rwvf6xqgsyb8bmpi7rwk9fildnwvzrv5-tzdata-2015c/= share/zoneinfo" > > # Tell 'modprobe' & co. where to look for modules. > export LINUX_MODULE_DIRECTORY=3D/run/booted-system/kernel/lib/modules Yes, that's why I suggest to add a note to the manual about a danger of using this field. > 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 shoot 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? > 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. But I agree that appending/prepending some lines may also be useful for those who like to keep the default /etc/profile and who just want to add something to it. > I think we should open a separate bug report to discuss this. I agree that it's not related to this bug, so I'm sending this message to guix-devel list. --=20 Alex