From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Danny O'Brien" Subject: bug#38243: Zsh does not load /etc/profile values by default Date: Sat, 7 Dec 2019 22:15:53 -0800 Message-ID: References: <02c4cef07e9f519697b9bbe9c6ab116fa2e2a404.camel@student.tugraz.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b9813b05992b3636" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34362) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idpsN-0008R4-E4 for bug-guix@gnu.org; Sun, 08 Dec 2019 01:17:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idpsM-00052e-1X for bug-guix@gnu.org; Sun, 08 Dec 2019 01:17:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44405) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idpsL-00051O-RS for bug-guix@gnu.org; Sun, 08 Dec 2019 01:17:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idpsL-0002En-Ny for bug-guix@gnu.org; Sun, 08 Dec 2019 01:17:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <02c4cef07e9f519697b9bbe9c6ab116fa2e2a404.camel@student.tugraz.at> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Leo Prikler Cc: 38243@debbugs.gnu.org --000000000000b9813b05992b3636 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Nov 17, 2019 at 5:22 AM Leo Prikler wrote: > > Not sure what the correct approach should be here. We could symlink > > /etc/zprofile to /etc/profile , but that would require knowing that > > /etc/profile was always available. Or we could include a source'ing > > of > > /etc/profile in /etc/zprofile. > I took a closer look at this, and currently Zsh users have /etc/profile included in their environment by virtue of a default $HOME/.zprofile, which is created in their home directory when they are created (via `useradd` and /etc/skel ). I'm a little stuck to know what to do here -- if we source /etc/profile in /etc/zprofile, then we risk sourcing it twice for users who have the current default ~/.zprofile already in their home directories`. OTOH, if users come to Guix System with their own pre-existing home directory, then they may well struggle --- as I did -- because important environment variables aren't set by their established ~/.zshrc, ~/.zprofile or ~/.zlogin setups. I *think* the right thing to do is to drop the current /etc/skel/.zprofile and establish that /etc/zprofile (and other shells) should source /etc/profile . Guix System does a lot of setup in /etc/profile including including $GUIX_PROFILE/etc/profile. It would be best if this automatically happened, whatever is going on in individual home directories. I'm a Guix newbie though, so I'm happy to take advice! Archlinux has a one-line /etc/zprofile which sources /etc/profile ; Debian does not; I have not checked other distributions, but I could. A couple of Guix commits where the current behavior was established: commit 2f4d43584cb26315c028dfbd2197da0d175933a2 Author: Chris Marusich Date: Sat Oct 13 22:50:36 2018 -0700 system: Rename .zlogin to .zprofile. Reported by Meiyo Peng . * gnu/system/shadow.scm (default-skeletons): Rename zlogin to zprofile. commit 02f707c590fa3c5bbd74168468bf561b47317f71 Author: Sou Bunnbu (=E5=AE=8B=E6=96=87=E6=AD=A6) Date: Fri Dec 5 21:17:49 2014 +0800 system: Add skeleton '.zlogin'. * gnu/system/shadow.scm (default-skeletons): Add .zlogin. Best, d. --000000000000b9813b05992b3636 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Nov 17, 2019 at 5:22 AM Leo P= rikler <leo.prikler@stu= dent.tugraz.at> wrote:
> Not sure what the correct approach should be here. We could symlink > /etc/zprofile to /etc/profile , but that would require knowing that > /etc/profile was always available. Or we could include a source'in= g
> of
> /etc/profile in /etc/zprofile.

I t= ook a closer look at this, and currently Zsh users have /etc/profile includ= ed in their environment by virtue of a default $HOME/.zprofile, which is cr= eated in their home directory when they are created (via `useradd` and /etc= /skel ).

I'm a little stuck to know what to do= here -- if we source /etc/profile in /etc/zprofile, then we risk sourcing = it twice for users who have the current default ~/.zprofile already in thei= r home directories`. OTOH, if users come to Guix System with their own pre-= existing home directory, then they may well struggle --- as I did -- becaus= e important environment variables aren't set by their established ~/.zs= hrc, ~/.zprofile or ~/.zlogin setups.

I *think* th= e right thing to do is to drop the current /etc/skel/.zprofile and establis= h that /etc/zprofile (and other shells) should source /etc/profile . Guix S= ystem does a lot of setup in /etc/profile including including $GUIX_PROFILE= /etc/profile.=C2=A0 It would be best if this automatically happened, whatev= er is going on in individual home directories. I'm a Guix newbie though= , so I'm happy to take advice!=C2=A0 Archlinux has a one-line /etc/zpro= file which sources /etc/profile ; Debian does not; I have not checked other= distributions, but I could.

A couple of Guix comm= its where the current behavior was established:

co= mmit 2f4d43584cb26315c028dfbd2197da0d175933a2
Author: Chris Marusich <= ;cmmarusich@gmail.com>
Da= te: =C2=A0 Sat Oct 13 22:50:36 2018 -0700

=C2=A0 =C2=A0 system: Rena= me .zlogin to .zprofile.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 Reported by Mei= yo Peng <meiyo.peng@gmail.com>.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 * gnu/system/shadow.scm (default-= skeletons): Rename zlogin to zprofile.

--000000000000b9813b05992b3636--