From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/2] services: postgresql: Add port to configuration Date: Mon, 12 Dec 2016 00:02:49 +0100 Message-ID: <87zik2xe5i.fsf@gnu.org> References: <20161211211301.28403-1-mail@cbaines.net> 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]:54016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGD8x-000128-U5 for guix-devel@gnu.org; Sun, 11 Dec 2016 18:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGD8u-0002qA-Nx for guix-devel@gnu.org; Sun, 11 Dec 2016 18:02:55 -0500 In-Reply-To: <20161211211301.28403-1-mail@cbaines.net> (Christopher Baines's message of "Sun, 11 Dec 2016 21:13:00 +0000") 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" To: Christopher Baines Cc: guix-devel@gnu.org Hi! Christopher Baines skribis: > * gnu/services/postgresql.scm (): Add port > field. > (postgresql-shepherd-service): Pass port to postgres. > (postgresql-service): Add port default. [...] > --- a/gnu/services/databases.scm > +++ b/gnu/services/databases.scm > @@ -48,6 +48,8 @@ > postgresql-configuration? > (postgresql postgresql-configuration-postgresql ; > (default postgresql)) > + (port postgresql-configuration-port > + (default 5432)) Could you update guix.texi to reflect these changes? > + (($ postgresql port config-file data-dire= ctory) > + (let* ((string-port (number->string port)) > + (start-script > + ;; Wrapper script that switches to the 'postgres' user befo= re > + ;; launching daemon. > + (program-file "start-postgres" > + #~(let ((user (getpwnam "postgres")) > + (postgres (string-append #$postgresql > + "/bin/postgr= es"))) > + (setgid (passwd:gid user)) > + (setuid (passwd:uid user)) > + (system* postgres > + (string-append "--config-file=3D" > + #$config-file) > + "-p" #$string-port I think you can omit the =E2=80=98string-port=E2=80=99 variable (confusing = name IMO :-)) and directly write: "-p" #$(number->string port) Could you send an updated patch? Thanks! Ludo=E2=80=99.