From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KALoOAeEHF/RUAAA0tVLHw (envelope-from ) for ; Sat, 25 Jul 2020 19:12:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sUJ+NAeEHF+OHQAAbx9fmQ (envelope-from ) for ; Sat, 25 Jul 2020 19:12:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 429979401CF for ; Sat, 25 Jul 2020 19:12:07 +0000 (UTC) Received: from localhost ([::1]:54794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jzPaX-00009V-Ql for larch@yhetil.org; Sat, 25 Jul 2020 15:12:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jzPaU-00009N-RF for guix-patches@gnu.org; Sat, 25 Jul 2020 15:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jzPaU-00016J-IP for guix-patches@gnu.org; Sat, 25 Jul 2020 15:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jzPaU-0000u8-Df for guix-patches@gnu.org; Sat, 25 Jul 2020 15:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41786] [PATCH] doc: Explain how to use psql with peer authentication. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Jul 2020 19:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41786 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Pierre Neidhardt Cc: 41786@debbugs.gnu.org Received: via spool by 41786-submit@debbugs.gnu.org id=B41786.15957042843428 (code B ref 41786); Sat, 25 Jul 2020 19:12:02 +0000 Received: (at 41786) by debbugs.gnu.org; 25 Jul 2020 19:11:24 +0000 Received: from localhost ([127.0.0.1]:51164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzPZs-0000tE-GT for submit@debbugs.gnu.org; Sat, 25 Jul 2020 15:11:24 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzPZq-0000t0-NJ for 41786@debbugs.gnu.org; Sat, 25 Jul 2020 15:11:23 -0400 Received: by mail-lj1-f195.google.com with SMTP id r19so13191411ljn.12 for <41786@debbugs.gnu.org>; Sat, 25 Jul 2020 12:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=qIQmLU1ZoRVV3iCvijy9g/KjtAbKNtKlG+u3aBtCfKQ=; b=MkYAtNovFXcN8fz38QCl89BDWRKjL7BO6Y3ZYmJ6U5QIRIeAbI592xO9F8F/NjVcAc zmMg91aSa86hqh15AEQL6GQrHLFb0z/UnzMX2y7LbaZ0dKmLvGe+BtoLYbywJpQl0yfn bE/6SosdvifAIObqp8LZ6SOVhd1oSeR+TfpNPGaBinJ1LNpUut/dcy5EZkVF6kgOZ8gF wiismJefhWc/g7g6KkiFzSiPC9G/s46T536ZMANF0sdl3rYbBxlrbKj5wnB9HC1hB7HW UGkZdSmAiPriNAoac3lYhqXwdgRLlryBOi9TL+HsztL9MjU9hEolc73dZs1VEMfuUozK Fa3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=qIQmLU1ZoRVV3iCvijy9g/KjtAbKNtKlG+u3aBtCfKQ=; b=cvpW8PCnKeuO1bfoaMMLaXBLYWnSjIvh3SvoB5VKe2Eap5Jns87Lw1ohLE8x4p1hkG OSvdqVCgG8W3XXk1rnRQDGUrYsrCYIevNtcB4IfOzUgI95JVrkQRxtgBA3v3psRizQsP rbIIIyhkBxWtt9L/rLcsZ43R2AF4tw69/woSTjIWhqCWXYJEq55HEFVGVQw7VEB0Iq4a VZ7PSqS0UvGXdgJvjzMaS+Q0TwrxciAi3LguRcPPWiXHIGz6DYNa+FnH5TYu5LcYxC80 laGtk6sHrdvewrabqhVGbJtVyXt3xvrKqkTSWZquip22tZji1oOsn0dbu8WDnCe8vhMA yXIw== X-Gm-Message-State: AOAM533Xd7NDhvC63M14yE4UvTtJr6BeeP8nMXxCvuortiKurRKfHIJ2 GuePMicz6AOYtgAawguZJhclyE2E X-Google-Smtp-Source: ABdhPJzSqjwrem5fyXWY2Uz5ujtA5v6x0/xatux0wtWPey+eUQ8RHJbhYm+t3dApHPNZKpbLL6vATg== X-Received: by 2002:a2e:504f:: with SMTP id v15mr1544358ljd.347.1595704276281; Sat, 25 Jul 2020 12:11:16 -0700 (PDT) Received: from guixsd (ppp91-122-98-213.pppoe.avangarddsl.ru. [91.122.98.213]) by smtp.gmail.com with ESMTPSA id n3sm1246146ljj.39.2020.07.25.12.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jul 2020 12:11:15 -0700 (PDT) From: Oleg Pykhalov References: <20200610093147.24347-1-mail@ambrevar.xyz> Date: Sat, 25 Jul 2020 22:11:12 +0300 In-Reply-To: <20200610093147.24347-1-mail@ambrevar.xyz> (Pierre Neidhardt's message of "Wed, 10 Jun 2020 11:31:47 +0200") Message-ID: <87blk3l8a7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=MkYAtNov; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -2.01 X-TUID: 3pekT+Uu7pmG --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Pierre, Pierre Neidhardt writes: > * doc/guix.texi (Database Services): Add example of shell commands to use= psql > as system user. Also add troubleshooting tip when service fails to start > because of incompatible cluster. > --- > doc/guix.texi | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 15e077a41c..1326be69e5 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -16787,6 +16787,24 @@ The PostgreSQL daemon loads its runtime configur= ation from @var{config-file}, > creates a database cluster with @var{locale} as the default > locale, stored in @var{data-directory}. It then listens on @var{port}. >=20=20 > +If the services fails to start, it may be due to an incompatible > +cluster already present in @var{data-directory}. Adjust it (or, if you > +don't need the cluster anymore, delete @var{data-directory}), then > +restart the service. OK, deleting data-directory probably will work for every issue, e.g. data corruption for files inside :-). Every =E2=80=98guix system reconfigure=E2=80=99 I see a message about =E2=80=9C/var/lib/postgresql/ already exists, skipping creating=E2=80=9D if= I remember correctly. Do you see this when you use a cluster?=20=20 I don't have a strong opinion for this, but the message is enough, isn't it? Maybe we could say in the documentation to remove data directory in any case when you don't need previous data? > +Peer authentication is used by default and the @code{postgres} user > +account has no shell, which prevents the direct execution of @code{psql} > +commands as this user. To use @code{psql}, you can temporarily log in > +as @code{postgres} using a shell, create a PostgreSQL superuser with the > +same name as one of the system users and then create the associated > +database. > + > +@example > +sudo su postgres -s /bin/sh > +createuser --interface > +createdb $MY_USER_LOGIN # Replace appropriately. > +@end example I tried =E2=80=98sudo su postgres -s /bin/sh=E2=80=99, then: =2D-8<---------------cut here---------------start------------->8--- sh-5.0$ createuser --interface sh: createuser: command not found =2D-8<---------------cut here---------------end--------------->8--- First of all we could use just =E2=80=98sudo=E2=80=99 to get a shell: sudo -u postgres -s /bin/sh =E2=80=98createuser=E2=80=99 and =E2=80=98createdb=E2=80=99 are in =E2=80= =98/gnu/store/=E2=80=A6-postgresql-10.13/bin=E2=80=99, which is missing in my =E2=80=98postgres=E2=80=99 user's profile. To fix this we could make =E2=80=98postgres=E2=80=99 available by default a= s in https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3Ddb65d7447c3adc46e2b= 24abfc07ae10c6c537df4 WDYT? Regards, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAl8cg9AACgkQFn+OpQAa +pw6Qw/9FQaG1UHYN4XyX53+sl1ZHCRDdMDllwlN6kX+Av73i4QTlhUDmQTC7udz n3qQt4otffAQg6BbnKm3gcklQo/nKjNwLlD9kcqBohjEN4nuaML2etEWURCX/Fli iib7WHmcu5AO9/f5hlJk8njUY5Sv/t7zNYTAc2OECNJUOknHNjXXHKZafotA6uS1 RWdfN33XWLr4zITb508zRMkD6Q2RZT2II42rIoCWib9Mxk7IfLBvg9LiyT7H80Fu +xXW0SBJHLpdLXsw0Z3W2EYrByANFuGJZh/rWBbJY3pyGt7XrnZBy2inmqDPSqnt fFhlU7kUL0UMikb9YS8JCT5w6vilECGMCziaFUYrEcaLg7AVd48tzi7prlS1UK17 QOAfAb/l3eeDg7iDWLSC54j0wgwSNzZLJ9wkVQisQr+1zTYQg/ORPcA/jXrrd/BO LCw428KW4gtxooRn+FEzpi6k5f5UeALhdthrWowarMgSwl9pLn/Lod3MQ1NZ40Es 9KHFMf24P9B6c6Og90JCCW6efEcl5LqiIbd3idXzguI7pJ8Qpqp53FZVNIYLz934 siW6+RRM1VPslUo8F7/HtvYo2veVxOCuAgZPktALl5/9RuMP4JZI8NJflytL2eam 0kHKplw9oH2GwI7/AMJAlE0AWpCw5pQXejodllt9TIB6WBWfdt8= =yh+P -----END PGP SIGNATURE----- --=-=-=--