From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: use zsh as login shell Date: Sat, 29 Nov 2014 11:24:13 +0800 Message-ID: <87vblyy9ia.fsf@gmail.com> References: <87k32gtz2p.fsf@gmail.com> <87mw7cjt7b.fsf@gnu.org> <87mw7b74ar.fsf@gmail.com> <8761dzynah.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]:35767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuYe9-00033z-4U for guix-devel@gnu.org; Fri, 28 Nov 2014 22:24:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuYe2-0004qM-1J for guix-devel@gnu.org; Fri, 28 Nov 2014 22:24:33 -0500 In-Reply-To: <8761dzynah.fsf@gnu.org> 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 Ludovic Court=C3=A8s writes: > =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > >> Ludovic Court=C3=A8s writes: >> >>> =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > > [...] > >>>> IMO, we should use `/etc/environment' for system variables: >>>> LANG=3Den_US.UTF-8 >>>> PATH=3D/run/current-system/profile/bin:/run/setuid-programs >>>> And add `pam_env.so' to /etc/pam.d/login, to make tty login work. >>>> >>>> With `/etc/profile', `/etc/zlogin' just: >>>> source /etc/environment >>>> to make `bash -l' and `zsh -l' work. >>> >>> Is =E2=80=98pam=C2=A0env=E2=80=99 needed at all if /etc/profile and /et= c/zlogin are provided >>> anyway? >> Yes, it's redundant. >> Now I think the better way is just provide /etc/environment. >> then `bash -l' would take ~/.bash_profile and ~/.profile. >> We can have a default ~/.bash_profile like: >> source /etc/environment >> export PATH=3D$PATH:$HOME/.guix-profile/bin > > Currently, the .bashrc skeleton sources /etc/profile. > > So, instead of what you suggest, what about having: > > 1. /etc/profile and /etc/zlogin (?) both source /etc/environment, > which uses plain Bourne syntax. > > 2. PATH is defined in /etc/environment and includes > ~/.guix-profile/bin. /etc/environment is defined by pam_env to be a simple KEY=3DVAL file, with = no support for varibales substitute. If we do not use pam_env (linux specified= ?), I think we should let /etc/zlogin source /etc/profile instead. And we don't want /etc/zlogin when not using zsh at all, IIUC while skeletons is configurable at the top os-expr, /etc/zlogin is not.=20 > > 3. The skeleton for ~/.bash_profile sources /etc/profile, /etc/bashrc, > and ~/.bashrc. > > 4. The definition of PS1 is moved from /etc/profile to /etc/bashrc. > > 5. The skeleton for ~/.bashrc sources /etc/bashrc. It seem too much, what I suggested is: for login, su (pam_env): /etc/environment for login shell: ~/.bash_profile, ~/.zlogin for interactive: ~/.bashrc, ~/.zshrc skeletons only installed when needed :) > > ? > > (I was reading the Bash manual to make sure (info "(bash) Bash Startup > Files"), and as an exercise, I=E2=80=99ve cleaned up my own ~/.bashrc and > ~/.bash_profile accordingly, which fixes the issue I reported a couple > of weeks ago regarding =E2=80=98guix environment=E2=80=99.) > > Thanks, > Ludo=E2=80=99.