From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 28 11:58:47 2018 Received: (at submit) by debbugs.gnu.org; 28 Jul 2018 15:58:47 +0000 Received: from localhost ([127.0.0.1]:33054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjRc8-0001LQ-Gt for submit@debbugs.gnu.org; Sat, 28 Jul 2018 11:58:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjRc6-0001LD-3j for submit@debbugs.gnu.org; Sat, 28 Jul 2018 11:58:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjRbz-00075x-Fy for submit@debbugs.gnu.org; Sat, 28 Jul 2018 11:58:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fjRbz-00075X-8f for submit@debbugs.gnu.org; Sat, 28 Jul 2018 11:58:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjRbx-0007Cp-GG for guix-patches@gnu.org; Sat, 28 Jul 2018 11:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjRbu-000710-CG for guix-patches@gnu.org; Sat, 28 Jul 2018 11:58:29 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:48958) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fjRbt-0006xG-Ru for guix-patches@gnu.org; Sat, 28 Jul 2018 11:58:26 -0400 Received: from localhost (i19-les01-t2-31-35-229-149.sfr.lns.abo.bbox.fr [31.35.229.149]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 8cb2b3f7 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for ; Sat, 28 Jul 2018 15:59:49 +0000 (UTC) Date: Sat, 28 Jul 2018 17:58:15 +0200 From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] make postgresql find its plugins Message-ID: <20180728175815.23b6e60d@lepiller.eu> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/d2F9gjbNqBQKVrpPQg+eEv1" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/d2F9gjbNqBQKVrpPQg+eEv1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, attached is a patch to make postgresql find its plugins. Actually, it only makes it unable to follow symlinks, so we can provide a union of postgresql and plugins to the postgresql service. I also attached an example system configuration that shows how this works. Do you think this is the right solution? The patch was taken from nixos and updated for the current version of postgresql. Note that the VM will have troubles loading the extensions with only its 256MB memory by default. You should add more ram to it. Inside the VM, you can test with: psql -U postgres > create database postgistest; > \connect postgistest; > create extension postgis; > create extension postgis_topology; no error, you now have an empty spatial database :) An extension would be to have a procedure to build the union of packages (postgresql and extensions) called by the postgresql service. we would have an "extension" field that would contain a list of packages that contain extensions for postgresql and the service would build and use the union of postgresql and these extensions. WDYT? --MP_/d2F9gjbNqBQKVrpPQg+eEv1 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-postgresql-Fix-finding-extensions.patch =46rom 74b24f0e0323174156d3407a83833a5a72b0174a Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 28 Jul 2018 17:38:38 +0200 Subject: [PATCH] gnu: postgresql: Fix finding extensions. * gnu/packages/patches/postgresql-disable-resolve_symlinks.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/databases.scm (postgresql)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/databases.scm | 5 ++-- .../postgresql-disable-resolve_symlinks.patch | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/postgresql-disable-resolve_symlink= s.patch diff --git a/gnu/local.mk b/gnu/local.mk index 612304bad..f98cf86e6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1037,6 +1037,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/polkit-drop-test.patch \ %D%/packages/patches/portaudio-audacity-compat.patch \ %D%/packages/patches/portmidi-modular-build.patch \ + %D%/packages/patches/postgresql-disable-resolve_symlinks.patch\ %D%/packages/patches/potrace-tests.patch \ %D%/packages/patches/procmail-ambiguous-getline-debian.patch \ %D%/packages/patches/procmail-CVE-2014-3618.patch \ diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 382c74cfd..562b66fde 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -18,7 +18,7 @@ ;;; Copyright =C2=A9 2016 Andy Patterson ;;; Copyright =C2=A9 2016 Danny Milosavljevic ;;; Copyright =C2=A9 2016, 2017, 2018 Marius Bakke -;;; Copyright =C2=A9 2017 Julien Lepiller +;;; Copyright =C2=A9 2017, 2018 Julien Lepiller ;;; Copyright =C2=A9 2017 Thomas Danckaert ;;; Copyright =C2=A9 2017 Jelle Licht ;;; Copyright =C2=A9 2017 Adriano Peluso @@ -713,7 +713,8 @@ as a drop-in replacement of MySQL.") version "/postgresql-" version ".tar.bz2= ")) (sha256 (base32 - "0j000bcs9w8wrllg8m7j1lxsd3n2x0yzkack5p35cmxx20iq2q0v")))) + "0j000bcs9w8wrllg8m7j1lxsd3n2x0yzkack5p35cmxx20iq2q0v")) + (patches (search-patches "postgresql-disable-resolve_symlinks.patch= ")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--with-uuid=3De2fs") diff --git a/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch= b/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch new file mode 100644 index 000000000..7874c37b9 --- /dev/null +++ b/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch @@ -0,0 +1,25 @@ +From 223c82d1d6ed1f29f26307249827ff679e09c780 Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Sat, 28 Jul 2018 12:22:12 +0200 +Subject: [PATCH] disable resolve_symlink + +--- + src/common/exec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/common/exec.c b/src/common/exec.c +index 878fc29..6b3e283 100644 +--- a/src/common/exec.c ++++ b/src/common/exec.c +@@ -218,6 +218,8 @@ find_my_exec(const char *argv0, char *retpath) + static int + resolve_symlinks(char *path) + { ++ // On GuixSD we *want* stuff relative to symlinks. ++ return 0; + #ifdef HAVE_READLINK + struct stat buf; + char orig_wd[MAXPGPATH], +--=20 +2.18.0 + --=20 2.18.0 --MP_/d2F9gjbNqBQKVrpPQg+eEv1 Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=postgis.scm ;; This is an operating system configuration template ;; for a "bare bones" setup, with no X11 display server. (use-modules (gnu) (guix packages) (guix build-system trivial)) (use-service-modules databases networking ssh) (use-package-modules databases geo screen ssh) (operating-system (host-name "komputilo") (timezone "Europe/Berlin") (locale "en_US.utf8") ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the ;; target hard disk, and "my-root" is the label of the target ;; root file system. (bootloader (bootloader-configuration (bootloader grub-bootloader) (target "/dev/sdX"))) (file-systems (cons (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) %base-file-systems)) ;; This is where user accounts are specified. The "root" ;; account is implicit, and is initially created with the ;; empty password. (users (cons (user-account (name "alice") (comment "Bob's sister") (group "users") ;; Adding the account to the "wheel" group ;; makes it a sudoer. Adding it to "audio" ;; and "video" allows the user to play sound ;; and access the webcam. (supplementary-groups '("wheel" "audio" "video")) (home-directory "/home/alice")) %base-user-accounts)) ;; Globally-installed packages. (packages (cons* screen openssh postgresql %base-packages)) ;; Add services to the baseline: a DHCP client and ;; an SSH server. (services (cons* (dhcp-client-service) (postgresql-service #:postgresql (package (name "postgresql") (version (package-version postgresql)) (source #f) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils) (srfi srfi-26)) (let* ((postgresql (assoc-ref %build-inputs "postgresql")) (postgis (assoc-ref %build-inputs "postgis")) (out (assoc-ref %outputs "out"))) (with-directory-excursion postgresql (for-each (lambda (file) (mkdir-p (string-append out "/" (dirname file))) (symlink (string-append postgresql "/" file) (string-append out "/" file))) (find-files "." ".*"))) (with-directory-excursion postgis (for-each (lambda (file) (mkdir-p (string-append out "/" (dirname file))) (symlink (string-append postgis "/" file) (string-append out "/" file))) (find-files "." ".*"))))))) (inputs `(("postgresql" ,postgresql) ("postgis" ,postgis))) (home-page "") (synopsis "") (description "") (license (package-license postgresql)))) (service openssh-service-type (openssh-configuration (port-number 2222))) %base-services))) --MP_/d2F9gjbNqBQKVrpPQg+eEv1-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 11:29:38 2018 Received: (at 32297) by debbugs.gnu.org; 14 Sep 2018 15:29:38 +0000 Received: from localhost ([127.0.0.1]:40855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0q2M-0006e9-Ew for submit@debbugs.gnu.org; Fri, 14 Sep 2018 11:29:38 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0q2K-0006du-WD for 32297@debbugs.gnu.org; Fri, 14 Sep 2018 11:29:37 -0400 Received: by mail-io1-f66.google.com with SMTP id l7-v6so6360554iok.6 for <32297@debbugs.gnu.org>; Fri, 14 Sep 2018 08:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=NNDFNTdWqBK9W0x0b/wM8/y12p+xRFvQ1Vy58K+R5e8=; b=hOfcHgn3/P1Le1sfB41V4zTbnfc+F8E2DQnu4idM9LcFUszV55pRGDLj4fF3m3I0A8 nQOx0MOhnZ1OA9FdQhsZDyHHST0+z97ujFm7W8y8G8/DyX/80oRkpxzhqz9yKFdaloC/ dlAN1ox/WBeC6AAJx79uWEiEJKYMzWUzQ+hBK4b+A0rmYL1mZx2DDAZ/cOt27KaaS2Rp NWHGsafN/P+FYaSvdayxUV148YGfRU/TV5h9ydV9I2dnHTOZYHuaFAY/GO7D7ftiMfJ5 CaGupuyUzr8kFYYBJ3Y2RavPTv8qsuN0PsTqD5PFP0LLflGySmwnn+AnblNSyh/u+2Qc sCEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=NNDFNTdWqBK9W0x0b/wM8/y12p+xRFvQ1Vy58K+R5e8=; b=agZduq3lWg3mhPzkPk0WTkmu8dFDqK3pKP4fLHXdodHMbeydB19zN3MfvmuoFF3Mqc tr5L5CO0+h1vw62kuq+nfjtt4N54E5mRZiJkSfU2I9sAQLc4eKxjKRl4EGW+m/YS3Z1B taAKVQ1TZ4PUkNtlffGjWctgKZzc3MHrdagEsum9aPsL5gi0EGNPGh+ai/Y5aidDER5B 2QUaT4r459picI8xEU6T+kImx9Qy9QMzwAKQA347wilcF1pRSyQo/q+FtwPG+33DNqL2 YcFHnfg4h3PdDGF2+A5ddeXnRyQLBcvkSz8aC95lZGJL5ZPJPlV3d5mHxQG4Qda7JbJx msQg== X-Gm-Message-State: APzg51BXk5R4r90oTpZMewRf9c5hPR7NTOkRtKKyML2fEU2ORm2qdMnU 5+lem2yKmjV1a+sEPN82ysz6I7DOczsAojHVLjBs X-Google-Smtp-Source: ANB0VdZ2vPUQT+Pnbe+rrQKAcMrCLgEviWHL84f4jyBtnP0IviKHw2F9+x6R2PBZlEKHzRq/suVmtkoo93h4vYW8WHs= X-Received: by 2002:a6b:e010:: with SMTP id z16-v6mr10956543iog.44.1536938971041; Fri, 14 Sep 2018 08:29:31 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Fri, 14 Sep 2018 17:29:19 +0200 Message-ID: Subject: [PATCH] make postgresql find its plugins To: 32297@debbugs.gnu.org, Julien Lepiller Content-Type: multipart/alternative; boundary="0000000000006917bf0575d67d37" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000006917bf0575d67d37 Content-Type: text/plain; charset="UTF-8" This looks good to me. The extensions field is a good idea. I also believe that after adding an extensions field it would be easier to document this. Do you think that it might be possible to list these extension packages somehow, or even stop them being directly installable, noting to use the extensions field in your service definition? Would that make sense? --0000000000006917bf0575d67d37 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This looks good to me.

The extensions f= ield is a good idea.

I also believe that after add= ing an extensions field it would be easier to document this.

=
Do you think that it might be possible to list these extension p= ackages somehow, or even stop them being directly installable, noting to us= e the extensions field in your service definition? Would that make sense?
--0000000000006917bf0575d67d37-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 16:04:12 2018 Received: (at 32297) by debbugs.gnu.org; 14 Sep 2018 20:04:12 +0000 Received: from localhost ([127.0.0.1]:40935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0uJv-0005KY-Uq for submit@debbugs.gnu.org; Fri, 14 Sep 2018 16:04:12 -0400 Received: from lepiller.eu ([89.234.186.109]:55232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0uJt-0005K6-Fv for 32297@debbugs.gnu.org; Fri, 14 Sep 2018 16:04:03 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id ba08df86 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <32297@debbugs.gnu.org>; Fri, 14 Sep 2018 20:05:14 +0000 (UTC) Date: Fri, 14 Sep 2018 22:03:53 +0200 From: Julien Lepiller To: 32297@debbugs.gnu.org Subject: Re: [PATCH] make postgresql find its plugins Message-ID: <20180914220353.538a9c9f@lepiller.eu> In-Reply-To: References: X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/7m.9eD+rya6jZ+jhOCrlCmr" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/7m.9eD+rya6jZ+jhOCrlCmr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 14 Sep 2018 17:29:19 +0200, G=C3=A1bor Boskovits a =C3=A9crit : > This looks good to me. >=20 > The extensions field is a good idea. >=20 > I also believe that after adding an extensions field it would be > easier to document this. Here is a new series of 2 patches: the first one is unchanged (only rebased to master) and the second one introduces the extensions field and documents it. I added an example in the documentation. >=20 > Do you think that it might be possible to list these extension > packages somehow, or even stop them being directly installable, > noting to use the extensions field in your service definition? Would > that make sense? Extension packages still have to be visible for users to list them in the new field, so it seems hard to hide them at the same time :) I agree it would make sense to be able to list all such extensions, and so is listing extensions to other packages. Maybe we can think of a generic mechanism for that? --MP_/7m.9eD+rya6jZ+jhOCrlCmr Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-postgresql-Fix-finding-extensions.patch =46rom db5d8bd717f84956a083c6dd7c772433c089da81 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 28 Jul 2018 17:38:38 +0200 Subject: [PATCH 1/2] gnu: postgresql: Fix finding extensions. * gnu/packages/patches/postgresql-disable-resolve_symlinks.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/databases.scm (postgresql)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/databases.scm | 5 ++-- .../postgresql-disable-resolve_symlinks.patch | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/postgresql-disable-resolve_symlink= s.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7b230cb6f..010aa76e5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1053,6 +1053,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/plotutils-libpng-jmpbuf.patch \ %D%/packages/patches/portaudio-audacity-compat.patch \ %D%/packages/patches/portmidi-modular-build.patch \ + %D%/packages/patches/postgresql-disable-resolve_symlinks.patch \ %D%/packages/patches/potrace-tests.patch \ %D%/packages/patches/procmail-ambiguous-getline-debian.patch \ %D%/packages/patches/procmail-CVE-2014-3618.patch \ diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 9db892a0b..722099732 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -18,7 +18,7 @@ ;;; Copyright =C2=A9 2016 Andy Patterson ;;; Copyright =C2=A9 2016 Danny Milosavljevic ;;; Copyright =C2=A9 2016, 2017, 2018 Marius Bakke -;;; Copyright =C2=A9 2017 Julien Lepiller +;;; Copyright =C2=A9 2017, 2018 Julien Lepiller ;;; Copyright =C2=A9 2017 Thomas Danckaert ;;; Copyright =C2=A9 2017 Jelle Licht ;;; Copyright =C2=A9 2017 Adriano Peluso @@ -812,7 +812,8 @@ as a drop-in replacement of MySQL.") version "/postgresql-" version ".tar.bz2= ")) (sha256 (base32 - "04a07jkvc5s6zgh6jr78149kcjmsxclizsqabjw44ld4j5n633kc")))) + "04a07jkvc5s6zgh6jr78149kcjmsxclizsqabjw44ld4j5n633kc")) + (patches (search-patches "postgresql-disable-resolve_symlink= s.patch")))) (build-system gnu-build-system) (arguments `(#:configure-flags '("--with-uuid=3De2fs") diff --git a/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch= b/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch new file mode 100644 index 000000000..97ef6928f --- /dev/null +++ b/gnu/packages/patches/postgresql-disable-resolve_symlinks.patch @@ -0,0 +1,25 @@ +From 223c82d1d6ed1f29f26307249827ff679e09c780 Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Sat, 28 Jul 2018 12:22:12 +0200 +Subject: [PATCH] disable resolve_symlink + +--- + src/common/exec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/common/exec.c b/src/common/exec.c +index 878fc29..6b3e283 100644 +--- a/src/common/exec.c ++++ b/src/common/exec.c +@@ -218,6 +218,8 @@ find_my_exec(const char *argv0, char *retpath) + static int + resolve_symlinks(char *path) + { ++ // On GuixSD we *want* stuff relative to symlinks. ++ return 0; + #ifdef HAVE_READLINK + struct stat buf; + char orig_wd[MAXPGPATH], +-- +2.18.0 + --=20 2.18.0 --MP_/7m.9eD+rya6jZ+jhOCrlCmr Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-postgresql-Add-extensions.patch =46rom 7a4684462142031c1590c6a0ef12a54aff04e396 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 14 Sep 2018 21:44:08 +0200 Subject: [PATCH 2/2] gnu: postgresql: Add extensions. * gnu/services/databases.scm (postgresql-configuration): Add extensions. (postgresql-shepherd-service): New key #:extensions. * doc/guix.texi (Database Services): Document it. --- doc/guix.texi | 34 +++++++++++++++++++++++++++++++++- gnu/services/databases.scm | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index cccf166d0..ecd486112 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13718,13 +13718,45 @@ The @code{(gnu services databases)} module provid= es the following services. =20 @deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ - [#:port 5432] [#:locale ``en_US.utf8''] + [#:port 5432] [#:locale ``en_US.utf8''] [#:extensions '()] Return a service that runs @var{postgresql}, the PostgreSQL database server. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e}, creates a database cluster with @var{locale} as the default locale, stored in @var{data-directory}. It then listens on @var{port}. + +@cindex postgresql extensions +Additional extensions are loaded from packages listed in @var{extensions}. +Extensions are available at runtime. For instance, to create a geographic +database using the @code{postgis} extension, a user can configure the +postgresql-service as in this example: + +@cindex postgis +@example +(use-package-modules databases geo) + +(operating-system + ... + ;; postgresql is required to run `psql' but postgis is not required for + ;; proper operation. + (packages (cons* postgresql %base-packages)) + (services + (cons* + (postgresql-service #:extensions (list postgis)) + %base-services))) +@end example + +Then the extension becomes visible and you can initialise an empty geograp= hic +database in this way: + +@example +psql -U postgres +> create database postgistest; +> \connect postgistest; +> create extension postgis; +> create extension postgis_topology; +@end example @end deffn =20 @deffn {Scheme Procedure} mysql-service [#:config (mysql-configuration)] diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index aff78a056..37bef2095 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2016 Leo Famulari ;;; Copyright =C2=A9 2017 Christopher Baines ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur +;;; Copyright =C2=A9 2018 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -150,7 +151,9 @@ host all all ::1/128 trust")) (config-file postgresql-configuration-file (default (postgresql-config-file))) (data-directory postgresql-configuration-data-directory - (default "/var/lib/postgresql/data"))) + (default "/var/lib/postgresql/data")) + (extensions postgresql-configuration-extensions + (default '()))) =20 (define %postgresql-accounts (list (user-group (name "postgres") (system? #t)) @@ -162,15 +165,33 @@ host all all ::1/128 trust")) (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) =20 +(define (final-postgresql postgresql extensions) + (if (null? extensions) + postgresql + (package + (inherit postgresql) + (source #f) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) (srfi srfi-26)) + (union-build (assoc-ref %outputs "out") %build-inputs) + #f))) + (inputs + `(("postgresql" ,postgresql) + ,@(map (lambda (extension) (cons "extension" extension)) extensio= ns)))))) + (define postgresql-activation (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) #~(begin (use-modules (guix build utils) (ice-9 match)) =20 (let ((user (getpwnam "postgres")) - (initdb (string-append #$postgresql "/bin/initdb")) + (initdb (string-append #$(final-postgresql postgresql exten= sions) "/bin/initdb")) (initdb-args (append (if #$locale @@ -202,7 +223,7 @@ host all all ::1/128 trust")) =20 (define postgresql-shepherd-service (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) (let* ((pg_ctl-wrapper ;; Wrapper script that switches to the 'postgres' user before ;; launching daemon. @@ -214,7 +235,7 @@ host all all ::1/128 trust")) (match (command-line) ((_ mode) (let ((user (getpwnam "postgres")) - (pg_ctl #$(file-append postgresql "/bin/pg_ctl"= )) + (pg_ctl #$(file-append (final-postgresql postgr= esql extensions) "/bin/pg_ctl")) (options (format #f "--config-file=3D~a -p ~d" #$config-file #$port))) (setgid (passwd:gid user)) @@ -253,7 +274,8 @@ host all all ::1/128 trust")) (port 5432) (locale "en_US.utf8") (config-file (postgresql-config-file)) - (data-directory "/var/lib/postgresql/data")) + (data-directory "/var/lib/postgresql/data") + (extensions '())) "Return a service that runs @var{postgresql}, the PostgreSQL database se= rver. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e} @@ -264,7 +286,8 @@ and stores the database cluster in @var{data-directory}= ." (port port) (locale locale) (config-file config-file) - (data-directory data-directory)))) + (data-directory data-directory) + (extensions extensions)))) =20 =0C ;;; --=20 2.18.0 --MP_/7m.9eD+rya6jZ+jhOCrlCmr-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 16:14:20 2018 Received: (at 32297) by debbugs.gnu.org; 14 Sep 2018 20:14:20 +0000 Received: from localhost ([127.0.0.1]:40947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0uTs-0005aj-DL for submit@debbugs.gnu.org; Fri, 14 Sep 2018 16:14:20 -0400 Received: from lepiller.eu ([89.234.186.109]:55234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0uTq-0005aX-K8 for 32297@debbugs.gnu.org; Fri, 14 Sep 2018 16:14:19 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 83fa4508 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <32297@debbugs.gnu.org>; Fri, 14 Sep 2018 20:15:32 +0000 (UTC) Date: Fri, 14 Sep 2018 22:14:07 +0200 From: Julien Lepiller To: 32297@debbugs.gnu.org Subject: Re: [bug#32297] [PATCH] make postgresql find its plugins Message-ID: <20180914221407.286de0e6@lepiller.eu> In-Reply-To: <20180914220353.538a9c9f@lepiller.eu> References: <20180914220353.538a9c9f@lepiller.eu> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/D7q23iIubwTDyw/uLXxZEus" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/D7q23iIubwTDyw/uLXxZEus Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 14 Sep 2018 22:03:53 +0200, Julien Lepiller a =C3=A9crit : > Le Fri, 14 Sep 2018 17:29:19 +0200, > G=C3=A1bor Boskovits a =C3=A9crit : >=20 > > This looks good to me. > >=20 > > The extensions field is a good idea. > >=20 > > I also believe that after adding an extensions field it would be > > easier to document this. =20 >=20 > Here is a new series of 2 patches: the first one is unchanged (only > rebased to master) and the second one introduces the extensions field > and documents it. I added an example in the documentation. >=20 > >=20 > > Do you think that it might be possible to list these extension > > packages somehow, or even stop them being directly installable, > > noting to use the extensions field in your service definition? Would > > that make sense? =20 >=20 > Extension packages still have to be visible for users to list them in > the new field, so it seems hard to hide them at the same time :) I > agree it would make sense to be able to list all such extensions, and > so is listing extensions to other packages. Maybe we can think of a > generic mechanism for that? Whoops, that last patch wasn't complete :) --MP_/D7q23iIubwTDyw/uLXxZEus Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-postgresql-Add-extensions.patch =46rom 69984999a9bd557e84318c025f693e2be5b8544b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 14 Sep 2018 21:44:08 +0200 Subject: [PATCH 2/2] gnu: postgresql: Add extensions. * gnu/services/databases.scm (postgresql-configuration): Add extensions. (postgresql-shepherd-service): New key #:extensions. * doc/guix.texi (Database Services): Document it. --- doc/guix.texi | 34 ++++++++++++++++++++++++++++++++- gnu/services/databases.scm | 39 +++++++++++++++++++++++++++++++------- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index cccf166d0..ecd486112 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13718,13 +13718,45 @@ The @code{(gnu services databases)} module provid= es the following services. =20 @deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ - [#:port 5432] [#:locale ``en_US.utf8''] + [#:port 5432] [#:locale ``en_US.utf8''] [#:extensions '()] Return a service that runs @var{postgresql}, the PostgreSQL database server. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e}, creates a database cluster with @var{locale} as the default locale, stored in @var{data-directory}. It then listens on @var{port}. + +@cindex postgresql extensions +Additional extensions are loaded from packages listed in @var{extensions}. +Extensions are available at runtime. For instance, to create a geographic +database using the @code{postgis} extension, a user can configure the +postgresql-service as in this example: + +@cindex postgis +@example +(use-package-modules databases geo) + +(operating-system + ... + ;; postgresql is required to run `psql' but postgis is not required for + ;; proper operation. + (packages (cons* postgresql %base-packages)) + (services + (cons* + (postgresql-service #:extensions (list postgis)) + %base-services))) +@end example + +Then the extension becomes visible and you can initialise an empty geograp= hic +database in this way: + +@example +psql -U postgres +> create database postgistest; +> \connect postgistest; +> create extension postgis; +> create extension postgis_topology; +@end example @end deffn =20 @deffn {Scheme Procedure} mysql-service [#:config (mysql-configuration)] diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index aff78a056..20d3481fc 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2016 Leo Famulari ;;; Copyright =C2=A9 2017 Christopher Baines ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur +;;; Copyright =C2=A9 2018 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,9 @@ #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages databases) + #:use-module (guix build-system trivial) #:use-module (guix modules) + #:use-module (guix packages) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -150,7 +153,9 @@ host all all ::1/128 trust")) (config-file postgresql-configuration-file (default (postgresql-config-file))) (data-directory postgresql-configuration-data-directory - (default "/var/lib/postgresql/data"))) + (default "/var/lib/postgresql/data")) + (extensions postgresql-configuration-extensions + (default '()))) =20 (define %postgresql-accounts (list (user-group (name "postgres") (system? #t)) @@ -162,15 +167,33 @@ host all all ::1/128 trust")) (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) =20 +(define (final-postgresql postgresql extensions) + (if (null? extensions) + postgresql + (package + (inherit postgresql) + (source #f) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) (srfi srfi-26)) + (union-build (assoc-ref %outputs "out") %build-inputs) + #f))) + (inputs + `(("postgresql" ,postgresql) + ,@(map (lambda (extension) (cons "extension" extension)) extensio= ns)))))) + (define postgresql-activation (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) #~(begin (use-modules (guix build utils) (ice-9 match)) =20 (let ((user (getpwnam "postgres")) - (initdb (string-append #$postgresql "/bin/initdb")) + (initdb (string-append #$(final-postgresql postgresql exten= sions) "/bin/initdb")) (initdb-args (append (if #$locale @@ -202,7 +225,7 @@ host all all ::1/128 trust")) =20 (define postgresql-shepherd-service (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) (let* ((pg_ctl-wrapper ;; Wrapper script that switches to the 'postgres' user before ;; launching daemon. @@ -214,7 +237,7 @@ host all all ::1/128 trust")) (match (command-line) ((_ mode) (let ((user (getpwnam "postgres")) - (pg_ctl #$(file-append postgresql "/bin/pg_ctl"= )) + (pg_ctl #$(file-append (final-postgresql postgr= esql extensions) "/bin/pg_ctl")) (options (format #f "--config-file=3D~a -p ~d" #$config-file #$port))) (setgid (passwd:gid user)) @@ -253,7 +276,8 @@ host all all ::1/128 trust")) (port 5432) (locale "en_US.utf8") (config-file (postgresql-config-file)) - (data-directory "/var/lib/postgresql/data")) + (data-directory "/var/lib/postgresql/data") + (extensions '())) "Return a service that runs @var{postgresql}, the PostgreSQL database se= rver. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e} @@ -264,7 +288,8 @@ and stores the database cluster in @var{data-directory}= ." (port port) (locale locale) (config-file config-file) - (data-directory data-directory)))) + (data-directory data-directory) + (extensions extensions)))) =20 =0C ;;; --=20 2.18.0 --MP_/D7q23iIubwTDyw/uLXxZEus-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 16:49:45 2018 Received: (at 32297) by debbugs.gnu.org; 14 Sep 2018 20:49:45 +0000 Received: from localhost ([127.0.0.1]:40958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0v28-0006dn-OK for submit@debbugs.gnu.org; Fri, 14 Sep 2018 16:49:45 -0400 Received: from lepiller.eu ([89.234.186.109]:55236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0v26-0006dc-DD for 32297@debbugs.gnu.org; Fri, 14 Sep 2018 16:49:43 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 05547cc0 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <32297@debbugs.gnu.org>; Fri, 14 Sep 2018 20:50:55 +0000 (UTC) Date: Fri, 14 Sep 2018 22:49:36 +0200 From: Julien Lepiller To: 32297@debbugs.gnu.org Subject: Re: [bug#32297] [PATCH] make postgresql find its plugins Message-ID: <20180914224936.1d33b9aa@lepiller.eu> In-Reply-To: <20180914221407.286de0e6@lepiller.eu> References: <20180914220353.538a9c9f@lepiller.eu> <20180914221407.286de0e6@lepiller.eu> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/bcy6Sh3C6CyULXC6ukzvjX6" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/bcy6Sh3C6CyULXC6ukzvjX6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Fri, 14 Sep 2018 22:14:07 +0200, Julien Lepiller a =C3=A9crit : > Le Fri, 14 Sep 2018 22:03:53 +0200, > Julien Lepiller a =C3=A9crit : >=20 > > Le Fri, 14 Sep 2018 17:29:19 +0200, > > G=C3=A1bor Boskovits a =C3=A9crit : > > =20 > > > This looks good to me. > > >=20 > > > The extensions field is a good idea. > > >=20 > > > I also believe that after adding an extensions field it would be > > > easier to document this. =20 > >=20 > > Here is a new series of 2 patches: the first one is unchanged (only > > rebased to master) and the second one introduces the extensions > > field and documents it. I added an example in the documentation. > > =20 > > >=20 > > > Do you think that it might be possible to list these extension > > > packages somehow, or even stop them being directly installable, > > > noting to use the extensions field in your service definition? > > > Would that make sense? =20 > >=20 > > Extension packages still have to be visible for users to list them > > in the new field, so it seems hard to hide them at the same time :) > > I agree it would make sense to be able to list all such extensions, > > and so is listing extensions to other packages. Maybe we can think > > of a generic mechanism for that? =20 >=20 > Whoops, that last patch wasn't complete :) I must be really tired, I spotted more mistakes after trying to run guix system on a config with postgis. --MP_/bcy6Sh3C6CyULXC6ukzvjX6 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-postgresql-Add-extensions.patch =46rom dd1f67a5682eb126f118d7aedd0842d855e38b19 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 14 Sep 2018 21:44:08 +0200 Subject: [PATCH 2/2] gnu: postgresql: Add extensions. * gnu/services/databases.scm (postgresql-configuration): Add extensions. (postgresql-shepherd-service): New key #:extensions. * doc/guix.texi (Database Services): Document it. --- doc/guix.texi | 34 +++++++++++++++++++++++++++++++- gnu/services/databases.scm | 40 +++++++++++++++++++++++++++++++------- 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index cccf166d0..ecd486112 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13718,13 +13718,45 @@ The @code{(gnu services databases)} module provid= es the following services. =20 @deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ - [#:port 5432] [#:locale ``en_US.utf8''] + [#:port 5432] [#:locale ``en_US.utf8''] [#:extensions '()] Return a service that runs @var{postgresql}, the PostgreSQL database server. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e}, creates a database cluster with @var{locale} as the default locale, stored in @var{data-directory}. It then listens on @var{port}. + +@cindex postgresql extensions +Additional extensions are loaded from packages listed in @var{extensions}. +Extensions are available at runtime. For instance, to create a geographic +database using the @code{postgis} extension, a user can configure the +postgresql-service as in this example: + +@cindex postgis +@example +(use-package-modules databases geo) + +(operating-system + ... + ;; postgresql is required to run `psql' but postgis is not required for + ;; proper operation. + (packages (cons* postgresql %base-packages)) + (services + (cons* + (postgresql-service #:extensions (list postgis)) + %base-services))) +@end example + +Then the extension becomes visible and you can initialise an empty geograp= hic +database in this way: + +@example +psql -U postgres +> create database postgistest; +> \connect postgistest; +> create extension postgis; +> create extension postgis_topology; +@end example @end deffn =20 @deffn {Scheme Procedure} mysql-service [#:config (mysql-configuration)] diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index aff78a056..59cd36c3f 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2016 Leo Famulari ;;; Copyright =C2=A9 2017 Christopher Baines ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur +;;; Copyright =C2=A9 2018 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,10 @@ #:use-module (gnu system shadow) #:use-module (gnu packages admin) #:use-module (gnu packages databases) + #:use-module (guix build-system trivial) + #:use-module (guix build union) #:use-module (guix modules) + #:use-module (guix packages) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) @@ -150,7 +154,9 @@ host all all ::1/128 trust")) (config-file postgresql-configuration-file (default (postgresql-config-file))) (data-directory postgresql-configuration-data-directory - (default "/var/lib/postgresql/data"))) + (default "/var/lib/postgresql/data")) + (extensions postgresql-configuration-extensions + (default '()))) =20 (define %postgresql-accounts (list (user-group (name "postgres") (system? #t)) @@ -162,15 +168,33 @@ host all all ::1/128 trust")) (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) =20 +(define (final-postgresql postgresql extensions) + (if (null? extensions) + postgresql + (package + (inherit postgresql) + (source #f) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils) (guix build union)) + #:builder + (begin + (use-modules (guix build utils) (guix build union) (srfi srfi-2= 6)) + (union-build (assoc-ref %outputs "out") (map (lambda (input) (c= dr input)) %build-inputs)) + #t))) + (inputs + `(("postgresql" ,postgresql) + ,@(map (lambda (extension) (list "extension" extension)) extensio= ns)))))) + (define postgresql-activation (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) #~(begin (use-modules (guix build utils) (ice-9 match)) =20 (let ((user (getpwnam "postgres")) - (initdb (string-append #$postgresql "/bin/initdb")) + (initdb (string-append #$(final-postgresql postgresql exten= sions) "/bin/initdb")) (initdb-args (append (if #$locale @@ -202,7 +226,7 @@ host all all ::1/128 trust")) =20 (define postgresql-shepherd-service (match-lambda - (($ postgresql port locale config-file data= -directory) + (($ postgresql port locale config-file data= -directory extensions) (let* ((pg_ctl-wrapper ;; Wrapper script that switches to the 'postgres' user before ;; launching daemon. @@ -214,7 +238,7 @@ host all all ::1/128 trust")) (match (command-line) ((_ mode) (let ((user (getpwnam "postgres")) - (pg_ctl #$(file-append postgresql "/bin/pg_ctl"= )) + (pg_ctl #$(file-append (final-postgresql postgr= esql extensions) "/bin/pg_ctl")) (options (format #f "--config-file=3D~a -p ~d" #$config-file #$port))) (setgid (passwd:gid user)) @@ -253,7 +277,8 @@ host all all ::1/128 trust")) (port 5432) (locale "en_US.utf8") (config-file (postgresql-config-file)) - (data-directory "/var/lib/postgresql/data")) + (data-directory "/var/lib/postgresql/data") + (extensions '())) "Return a service that runs @var{postgresql}, the PostgreSQL database se= rver. =20 The PostgreSQL daemon loads its runtime configuration from @var{config-fil= e} @@ -264,7 +289,8 @@ and stores the database cluster in @var{data-directory}= ." (port port) (locale locale) (config-file config-file) - (data-directory data-directory)))) + (data-directory data-directory) + (extensions extensions)))) =20 =0C ;;; --=20 2.18.0 --MP_/bcy6Sh3C6CyULXC6ukzvjX6-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 07:23:58 2018 Received: (at 32297) by debbugs.gnu.org; 24 Sep 2018 11:23:58 +0000 Received: from localhost ([127.0.0.1]:51390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Oy6-0008V5-0W for submit@debbugs.gnu.org; Mon, 24 Sep 2018 07:23:58 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:45691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Oy4-0008Ur-IC for 32297@debbugs.gnu.org; Mon, 24 Sep 2018 07:23:57 -0400 Received: by mail-io1-f66.google.com with SMTP id e12-v6so17241965iok.12 for <32297@debbugs.gnu.org>; Mon, 24 Sep 2018 04:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4g2cI3cpYQ4LPAEtHNQxg7IUsu6rP8UFT9boRtPQ368=; b=uK6UkwUP6RqZQYEsnDGkFj5IJT/D13ysUDo72EqOXA67PqsbjmEVNbufr4hIsGy4X5 KEr4XvrTodDUfWi2BALuLxj8hKCIJ8JY2xhMmjzNAUkgf3wt8P9bxn2Dv5WQnaJ+goVu ILoLUQd6br2eAiOzNzAmDo8G+NlW/r5Wfhw/KuRrmnm5Oue0FFoMtsGtnXaXHIa3YnaP Cjm9OGF2ZB/I2y4ijs0Dbcpulr1hpdfk1xYg8YgGZsXGmqP4Ycv+K25EYlHSxXIfoL83 nRWKqcxlnzuBtLX9b0QqEdPhqewoF56fL8A5pd5T8D0BCTg57jczly2l5YnBVS5RzejE zUxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4g2cI3cpYQ4LPAEtHNQxg7IUsu6rP8UFT9boRtPQ368=; b=ZgsQUcSx0mxkwEVFsPcjIomJ/9SccVjs6oa4ekvmnpXiOljD8YdeYm79Qt5egLQ5Js m8/yVXOBl3eaqLkR1bmEPDDuUWTYGFXHAWvybK0Xou2xQpDEri+6xSaYUURc1jxHknqF oBn7OrUCwPUPv1gaxvQtQXeY1uZNPmDD+hr+GGMq3wRRnU75WByR1kl00De2Zufqy8w8 9mAASmW0ms2G4M3BWtxYWndCm2DWnIT2hUooUxl5v74SNh3g/EcAU78DDWWopu/y275W PHv00J6vd8Zg8ICok3kYDGw0iSc5PX3rvZ1dDC0IW6BSBnLEATxuwP7KhofmXydbx9XC t2WA== X-Gm-Message-State: ABuFfogBrtSRQwpxczOe0U/WWTzqI/5xBv4zD1JlFwpAqbXBVJXPPSXf ok3wrKC6NOFQJ0G6T++0AlOmv0oCyZCAI905vld/IJM= X-Google-Smtp-Source: ACcGV61I2URXA2zcZqJisyHSwyKpxqgY7I5/DZ0H1ti7X9fsdeTaMY7EvmSeN+VEygy18wF1yOociNNYYPXEYmJ+LZ0= X-Received: by 2002:a5e:950d:: with SMTP id r13-v6mr7196656ioj.224.1537788230315; Mon, 24 Sep 2018 04:23:50 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Mon, 24 Sep 2018 13:23:38 +0200 Message-ID: Subject: make postgresql find its plugins To: 32297@debbugs.gnu.org, Julien Lepiller Content-Type: multipart/alternative; boundary="0000000000003533da05769c3999" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000003533da05769c3999 Content-Type: text/plain; charset="UTF-8" It works fine for me. Some things I noticed while checking this: 1. postgresql contrib extensions should not be listed, and are working even without the patches. (This includes for example hstore, dblink,... see https://www.postgresql.org/docs/current/static/contrib.html for the full list) Did not test if it is problem if one adds these to the config though. 2. I had postgis actually missing, due to a missing use module, but there was no complaint, system reconfigure went just fine, but creating extension postgis did not work. Can we add some way to check if the list supplied is sane? 3. contrib extensions also work fine with the patches applied. 4. I did not test if it works if we have more than one extension, but it looks good. If we have any other extension packaged, we could take a look. 5. Do you think we should add a test? 6. I got a warning that the first patch introduces whitespace errors on current master. Is that ok? --0000000000003533da05769c3999 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It works fine for me.

= Some things I noticed while checking this:
1. postgresql contrib = extensions should not be listed, and are working even without the patches. = (This includes for example hstore, dblink,...
see=C2=A0https://www.p= ostgresql.org/docs/current/static/contrib.html=C2=A0for the full list)<= /div>
Did not test if it is problem if one adds these to the config tho= ugh.
2. I had postgis actually missing, due to a missing use modu= le, but there was no complaint, system reconfigure went just fine, but crea= ting extension postgis did not work. Can we add some way to check if the li= st supplied is sane?
3. contrib extensions also work fine with th= e patches applied.
4. I did not test if it works if we have more = than one extension, but it looks good.
If we have any other exten= sion packaged, we could take a look.
5. Do you think we should ad= d a test?
6. I got a warning that the first patch introduces whit= espace errors on current master. Is that ok?

--0000000000003533da05769c3999-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 04 16:36:57 2018 Received: (at 32297-done) by debbugs.gnu.org; 4 Oct 2018 20:36:57 +0000 Received: from localhost ([127.0.0.1]:37095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8AMh-0006Vr-1v for submit@debbugs.gnu.org; Thu, 04 Oct 2018 16:36:57 -0400 Received: from lepiller.eu ([89.234.186.109]:56092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8AMe-0006Vi-SI for 32297-done@debbugs.gnu.org; Thu, 04 Oct 2018 16:36:53 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id e6c737b0 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <32297-done@debbugs.gnu.org>; Thu, 4 Oct 2018 20:38:47 +0000 (UTC) Date: Thu, 4 Oct 2018 22:36:47 +0200 From: Julien Lepiller To: 32297-done@debbugs.gnu.org Subject: Re: make postgresql find its plugins Message-ID: <20181004223647.1b413458@lepiller.eu> In-Reply-To: References: X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32297-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Mon, 24 Sep 2018 13:23:38 +0200, G=C3=A1bor Boskovits a =C3=A9crit : > It works fine for me. >=20 > Some things I noticed while checking this: > 1. postgresql contrib extensions should not be listed, and are > working even without the patches. (This includes for example hstore, > dblink,... see > https://www.postgresql.org/docs/current/static/contrib.html for the > full list) Did not test if it is problem if one adds these to the > config though. 2. I had postgis actually missing, due to a missing > use module, but there was no complaint, system reconfigure went just > fine, but creating extension postgis did not work. Can we add some > way to check if the list supplied is sane? > 3. contrib extensions also work fine with the patches applied. > 4. I did not test if it works if we have more than one extension, but > it looks good. > If we have any other extension packaged, we could take a look. > 5. Do you think we should add a test? > 6. I got a warning that the first patch introduces whitespace errors > on current master. Is that ok? Pushed on staging since the changes to postgresql requires a lot of rebuilds. The whitespace error is located in parts of the patch I can't change. I've also added a sentence to the manual to make it clear that you should list packages and not extensions themselves, and that you don't need to add contrib extensions in the field. Otherwise, I think I've addressed all your comments :) Thank you for your review! From unknown Fri Jun 20 07:15:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 02 Nov 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator