all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: 宋文武 <iyzsong@openmailbox.org>
Cc: guix-devel@gnu.org
Subject: Re: Adding operating-system field for a custom /etc/profile.
Date: Tue, 24 Nov 2015 23:03:43 +0300	[thread overview]
Message-ID: <87ziy3qi5c.fsf@gmail.com> (raw)
In-Reply-To: <3fa07a3d615d80be9fb10da9e026ae48@openmailbox.org> ("宋文武"'s message of "Tue, 24 Nov 2015 23:22:17 +0800")

宋文武 (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:
>> <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20255#44>.
>>
>> 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ès (2015-11-23 17:31 +0300) wrote:
>>
>>> Hmm, I’m not sure if we want to give direct access to /etc/profile
>>> 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 ‘profile-file’ 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: «We will not provide "rm" command, because a newcomer may
>> accidentally run "rm -rf ~"».  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?
> 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=VALUE
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=VAL 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.

-- 
Alex

  reply	other threads:[~2015-11-24 20:03 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 10:29 bug#20255: 'search-paths' should respect both user and system profile 宋文武
2015-04-04 21:04 ` Ludovic Courtès
2015-04-05  3:39   ` 宋文武
2015-04-05 18:15     ` Ludovic Courtès
2015-04-06  4:02       ` 宋文武
2015-04-06  8:24         ` Mark H Weaver
2015-05-02 22:12         ` Ludovic Courtès
2015-11-19 22:32           ` Ludovic Courtès
2015-11-20 22:42             ` Alex Kost
2015-11-21  8:57               ` Ludovic Courtès
2015-11-21 18:41                 ` Alex Kost
2015-11-21 20:10                   ` Ludovic Courtès
2015-11-22  7:52                     ` Alex Kost
2015-11-22 10:52                       ` Ludovic Courtès
2015-11-22 18:44                         ` Alex Kost
2015-11-22 23:04                           ` Ludovic Courtès
2015-11-23 11:55                             ` Alex Kost
2015-11-23 14:31                               ` Ludovic Courtès
2015-11-23 20:07                                 ` Adding operating-system field for a custom /etc/profile Alex Kost
2015-11-24 12:48                                   ` Ludovic Courtès
2015-11-24 19:36                                     ` Alex Kost
2015-11-24 20:30                                       ` Ludovic Courtès
2015-11-30  9:10                                         ` Alex Kost
2015-11-30 13:00                                           ` Ludovic Courtès
2015-11-24 15:22                                   ` 宋文武
2015-11-24 20:03                                     ` Alex Kost [this message]
2015-11-27 14:58                                       ` Customizing /etc Ludovic Courtès
2015-11-30  9:11                                         ` Alex Kost
2015-11-27 14:34                                     ` /etc/environment and /etc/profile Ludovic Courtès
2015-11-24 17:22                       ` bug#20255: 'search-paths' should respect both user and system profile Ludovic Courtès
2015-11-30  9:08                         ` Alex Kost
2015-11-30 12:25                           ` Ludovic Courtès
2015-05-04 21:44     ` Ludovic Courtès
2015-05-05  8:28       ` 宋文武
2015-05-05 12:35         ` Ludovic Courtès
2015-05-06 16:35         ` Ludovic Courtès
2015-11-12 11:13       ` Ludovic Courtès
2020-02-21 15:53 ` bug#20255: (old)bug#20255: 'search-paths' should respect both user and system profiles zimoun
2020-02-21 17:18   ` Alex Kost
2021-06-26  2:37     ` bug#20255: 'search-paths' should respect both user and system profile Maxim Cournoyer
2021-06-26  5:59       ` Leo Prikler
2021-06-28  4:35         ` Maxim Cournoyer
2021-06-28  6:58           ` Leo Prikler
2021-06-27  9:59       ` Alex Kost
2021-06-28  4:48         ` Maxim Cournoyer
2021-06-29 17:29           ` Alex Kost
2020-12-18 20:27   ` bug#20255: «the Oldest» [PATCH] 'search-paths' should respect both user and system profiles zimoun
2023-05-12 12:34     ` bug#20255: 'search-paths' should respect both user and system profile 宋文武 via Bug reports for GNU Guix
2023-05-15 13:53       ` Maxim Cournoyer
2023-05-17 14:12         ` 宋文武
2023-05-15 17:14       ` Josselin Poiret via Bug reports for GNU Guix
2023-05-15 17:46         ` Maxim Cournoyer
2023-05-16  9:37           ` Josselin Poiret via Bug reports for GNU Guix
2023-05-16 11:00             ` 宋文武 via Bug reports for GNU Guix
2023-05-17 14:04 ` bug#20255: [PATCH 1/4] home: shells: Merge search-paths of multiple profiles iyzsong--- via Bug reports for GNU Guix
2023-05-17 14:04   ` bug#20255: [PATCH 2/4] system: default-skeletons: Set up Guix home profile when it exists iyzsong--- via Bug reports for GNU Guix
2023-05-17 14:04   ` bug#20255: [PATCH 3/4] system: Only source system profile's settings in '/etc/profile' iyzsong--- via Bug reports for GNU Guix
2023-05-17 14:04   ` bug#20255: [PATCH 4/4] news: Add entry for '/etc/profile' changes iyzsong--- via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ziy3qi5c.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@openmailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.