From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Changing user-account's shell Date: Fri, 19 Apr 2019 14:04:56 +0200 Message-ID: <87r29yciaf.fsf@gnu.org> References: <20190417195944.v3duu4wzh7sqj7dk@melmoth> <87pnpjqsmg.fsf@gnu.org> <20190418205131.mthcnvo3dodf3pvx@melmoth> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHSKb-0005pm-P3 for help-guix@gnu.org; Fri, 19 Apr 2019 08:09:26 -0400 In-Reply-To: <20190418205131.mthcnvo3dodf3pvx@melmoth> (Tanguy Le Carrour's message of "Thu, 18 Apr 2019 22:51:31 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Tanguy Le Carrour Cc: help-guix@gnu.org Hi Tanguy, Tanguy Le Carrour skribis: > Le 04/18, Ludovic Court=C3=A8s a =C3=A9crit : >> Tanguy Le Carrour skribis: >> > I'm trying to set my user's shell through the Guix configuration syste= m, >> > but without success. >> > [=E2=80=A6] >> > (users (cons (user-account >> > ;; ... >> > (shell (file-append fish "/bin/fish"))) >> > %base-user-accounts)) >> > [=E2=80=A6]=20 >> Could you tell us what command you run and what error message you got? >> At first sight this looks good to me. > > I run `sudo -E guix system reconfigure my_config.scm` and I don't get > any error message. > > The "funny" thing is, if I add a second user to the system, setting > Fish as its default shell, it's added with Fish as its default shell! > > If I remove `(shell (file-append fish "/bin/fish"))` from the newly > created account and re-run `guix system reconfigure`, the shell is still > Fish. > > If I add `(shell (file-append bash "/bin/bash"))` to the newly > created account and re-run `guix system reconfigure`, the shell is still > Fish. > > Bug or feature?! I say =E2=80=9Cfeature=E2=80=9D, but we can discuss it. :-) The (gnu build accounts) module, which populates /etc/passwd, considers the user shell to be =E2=80=9Cstate=E2=80=9D=E2=80=94i.e., something the us= er can change with =E2=80=98chsh=E2=80=99 and which is preserved, pretty much like passwords c= hanged with =E2=80=98passwd=E2=80=99. This happens here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/accounts.scm#n4= 86 Thus, when you reconfigure, if the user already exists, its current shell is preserved, regardless of what you put in the configuration. I think this is what makes the most sense on a multi-user system: users shouldn=E2=80=99t have to ask the admins to change their shell. On a single-user system, it=E2=80=99s a bit different, but you can do both:= use =E2=80=98chsh=E2=80=99, and adjust your OS config so that it=E2=80=99s corr= ect from the start when you reinstall. WDYT? Thanks, Ludo=E2=80=99.