From patchwork Mon Oct 19 19:02:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 24699 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0EE2327BBEE; Mon, 19 Oct 2020 20:10:54 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E0B8E27BBED for ; Mon, 19 Oct 2020 20:10:53 +0100 (BST) Received: from localhost ([::1]:48610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUaYX-0008CE-3z for patchwork@mira.cbaines.net; Mon, 19 Oct 2020 15:10:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUaRv-0001DC-E3 for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUaRu-000118-D2 for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUaRu-0008G5-9Q for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH v2 1/5] tests: monitoring: Use (service postgresql-service-type). Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160313418331611 (code B ref 43771); Mon, 19 Oct 2020 19:04:02 +0000 Received: (at 43771) by debbugs.gnu.org; 19 Oct 2020 19:03:03 +0000 Received: from localhost ([127.0.0.1]:42429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQx-0008Da-FJ for submit@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:03 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQw-0008D3-BC for 43771@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:02 -0400 Received: from localhost (188.28.126.178.threembb.co.uk [188.28.126.178]) by mira.cbaines.net (Postfix) with ESMTPSA id D865927BBED for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 20:03:01 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 94c13bce for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 19:02:59 +0000 (UTC) From: Christopher Baines Date: Mon, 19 Oct 2020 20:02:55 +0100 Message-Id: <20201019190259.11356-1-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <87lfgl3wb7.fsf@gnu.org> References: <87lfgl3wb7.fsf@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches As I'm looking at removing the procedure, in favour of always using the service type. * gnu/tests/monitoring.scm (%zabbix-os): Use (service postgresql-service-type) rather than (postgresql-service). --- gnu/tests/monitoring.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm index d20b8ac59e..17b9edc3ac 100644 --- a/gnu/tests/monitoring.scm +++ b/gnu/tests/monitoring.scm @@ -307,7 +307,7 @@ zabbix||{} (let ((base-os (simple-operating-system (service dhcp-client-service-type) - (postgresql-service) + (service postgresql-service-type) (service zabbix-front-end-service-type (zabbix-front-end-configuration (db-password "zabbix"))) From patchwork Mon Oct 19 19:02:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 24698 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8979927BBEE; Mon, 19 Oct 2020 20:05:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 45BF727BBED for ; Mon, 19 Oct 2020 20:05:16 +0100 (BST) Received: from localhost ([::1]:34042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUaT5-0001ww-DD for patchwork@mira.cbaines.net; Mon, 19 Oct 2020 15:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUaRv-0001DD-EV for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUaRu-00011A-Od for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUaRu-0008GC-Kv for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH v2 2/5] doc: Add subheadings in to the Databases section. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160313418431618 (code B ref 43771); Mon, 19 Oct 2020 19:04:02 +0000 Received: (at 43771) by debbugs.gnu.org; 19 Oct 2020 19:03:04 +0000 Received: from localhost ([127.0.0.1]:42431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQx-0008Do-RM for submit@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:04 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQw-0008D5-Dk for 43771@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:03 -0400 Received: from localhost (188.28.126.178.threembb.co.uk [188.28.126.178]) by mira.cbaines.net (Postfix) with ESMTPSA id EFD0427BBEE for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 20:03:01 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 67366954 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 19:02:59 +0000 (UTC) From: Christopher Baines Date: Mon, 19 Oct 2020 20:02:56 +0100 Message-Id: <20201019190259.11356-2-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201019190259.11356-1-mail@cbaines.net> References: <87lfgl3wb7.fsf@gnu.org> <20201019190259.11356-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches To make it clearer where the relevant documentation for a particular service starts and ends. * doc/guix.texi (Database Services): Add subheadings. --- doc/guix.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 130985d30f..d6d610acae 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18178,6 +18178,8 @@ details. @cindex SQL The @code{(gnu services databases)} module provides the following services. +@subsubheading PostgreSQL + @deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ [#:port 5432] [#:locale ``en_US.utf8''] [#:extension-packages '()] @@ -18243,6 +18245,8 @@ dblink as they are already loadable by postgresql. This field is only required to add extensions provided by other packages. @end deffn +@subsubheading MariaDB/MySQL + @deffn {Scheme Procedure} mysql-service [#:config (mysql-configuration)] Return a service that runs @command{mysqld}, the MySQL or MariaDB database server. @@ -18267,6 +18271,8 @@ TCP port on which the database server listens for incoming connections. @end table @end deftp +@subsubheading Memcached + @defvr {Scheme Variable} memcached-service-type This is the service type for the @uref{https://memcached.org/, Memcached} service, which provides a distributed in memory cache. The @@ -18299,6 +18305,8 @@ Additional command line options to pass to @code{memcached}. @end table @end deftp +@subsubheading MongoDB + @defvr {Scheme Variable} mongodb-service-type This is the service type for @uref{https://www.mongodb.com/, MongoDB}. The value for the service type is a @code{mongodb-configuration} object. @@ -18325,6 +18333,8 @@ MongoDB is configured to use through the configuration file. @end table @end deftp +@subsubheading Redis + @defvr {Scheme Variable} redis-service-type This is the service type for the @uref{https://redis.io/, Redis} key/value store, whose value is a @code{redis-configuration} object. From patchwork Mon Oct 19 19:02:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 24695 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 71FC527BBEE; Mon, 19 Oct 2020 20:04:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1F19C27BBED for ; Mon, 19 Oct 2020 20:04:27 +0100 (BST) Received: from localhost ([::1]:60670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUaSI-0001Eq-6h for patchwork@mira.cbaines.net; Mon, 19 Oct 2020 15:04:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUaRv-0001DF-Sb for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUaRv-00011N-GV for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUaRv-0008GR-D1 for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH v2 3/5] services: databases: Deprecate the postgresql-service procedure. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 19:04:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160313419531643 (code B ref 43771); Mon, 19 Oct 2020 19:04:03 +0000 Received: (at 43771) by debbugs.gnu.org; 19 Oct 2020 19:03:15 +0000 Received: from localhost ([127.0.0.1]:42435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaR8-0008ED-Ge for submit@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:14 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQw-0008D6-Gh for 43771@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:03 -0400 Received: from localhost (188.28.126.178.threembb.co.uk [188.28.126.178]) by mira.cbaines.net (Postfix) with ESMTPSA id 0F30227BBF0 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 20:03:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6fb2aa3d for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 19:02:59 +0000 (UTC) From: Christopher Baines Date: Mon, 19 Oct 2020 20:02:57 +0100 Message-Id: <20201019190259.11356-3-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201019190259.11356-1-mail@cbaines.net> References: <87lfgl3wb7.fsf@gnu.org> <20201019190259.11356-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Using the service type directly is a better approach, making it easier to configure the service. * gnu/services/databases.scm (postgresql-service): Deprecate this procedure. * doc/guix.texi (PostgreSQL): Update the documentation for the use of (service postgresql-service-type). --- doc/guix.texi | 40 +++++++++++++++++++++++++++++--------- gnu/services/databases.scm | 14 +++++++------ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d6d610acae..8aaa896c8d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18180,15 +18180,12 @@ The @code{(gnu services databases)} module provides the following services. @subsubheading PostgreSQL -@deffn {Scheme Procedure} postgresql-service [#:postgresql postgresql] @ - [#:config-file] [#:data-directory ``/var/lib/postgresql/data''] @ - [#:port 5432] [#:locale ``en_US.utf8''] [#:extension-packages '()] -Return a service that runs @var{postgresql}, the PostgreSQL database -server. +The following example describes a PostgreSQL service with the default +configuration. -The PostgreSQL daemon loads its runtime configuration 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}. +@lisp +(service postgresql-service-type) +@end lisp 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 @@ -18208,6 +18205,29 @@ createuser --interactive createdb $MY_USER_LOGIN # Replace appropriately. @end example +@deftp {Data Type} postgresql-configuration +Data type representing the configuration for the +@code{postgresql-service-type}. + +@table @asis +@item @var{postgresql} (default: @code{postgresql}) +PostgreSQL package to use for the service. + +@item @var{port} (default: @code{5432}) +Port on which PostgreSQL should listen. + +@item @var{locale} (default: @code{"en_US.utf8"}) +Locale to use as the default when creating the database cluster. + +@item @var{config-file} (default: @code{(postgresql-config-file)}) +The configuration file to use when running PostgreSQL. The default +behaviour uses the postgresql-config-file record with the default values +for the fields. + +@item @var{data-directory} (default: @code{"/var/lib/postgresql/data"}) +Directory in which to store the data. + +@item @var{extension-packages} (default: @code{'()}) @cindex postgresql extension-packages Additional extensions are loaded from packages listed in @var{extension-packages}. Extensions are available at runtime. For instance, @@ -18243,7 +18263,9 @@ psql -U postgres There is no need to add this field for contrib extensions such as hstore or dblink as they are already loadable by postgresql. This field is only required to add extensions provided by other packages. -@end deffn + +@end table +@end deftp @subsubheading MariaDB/MySQL diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 2bddf70f71..7908a3e0f6 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages databases) #:use-module (guix build-system trivial) #:use-module (guix build union) + #:use-module (guix deprecation) #:use-module (guix modules) #:use-module (guix packages) #:use-module (guix records) @@ -281,12 +282,13 @@ host all all ::1/128 md5")) (compose list postgresql-configuration-postgresql)))) (default-value (postgresql-configuration)))) -(define* (postgresql-service #:key (postgresql postgresql) - (port 5432) - (locale "en_US.utf8") - (config-file (postgresql-config-file)) - (data-directory "/var/lib/postgresql/data") - (extension-packages '())) +(define-deprecated (postgresql-service #:key (postgresql postgresql) + (port 5432) + (locale "en_US.utf8") + (config-file (postgresql-config-file)) + (data-directory "/var/lib/postgresql/data") + (extension-packages '())) + postgresql-service-type "Return a service that runs @var{postgresql}, the PostgreSQL database server. The PostgreSQL daemon loads its runtime configuration from @var{config-file} From patchwork Mon Oct 19 19:02:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 24696 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 046C427BBEE; Mon, 19 Oct 2020 20:04:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CB1CA27BBED for ; Mon, 19 Oct 2020 20:04:28 +0100 (BST) Received: from localhost ([::1]:60736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUaSJ-0001HK-SP for patchwork@mira.cbaines.net; Mon, 19 Oct 2020 15:04:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUaRv-0001DE-EF for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59141) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUaRv-00011B-5G for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUaRv-0008GJ-10 for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH v2 4/5] gnu: databases: Define postgresql-10. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160313419431636 (code B ref 43771); Mon, 19 Oct 2020 19:04:02 +0000 Received: (at 43771) by debbugs.gnu.org; 19 Oct 2020 19:03:14 +0000 Received: from localhost ([127.0.0.1]:42433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaR8-0008EB-7t for submit@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:14 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQw-0008DD-KC for 43771@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:03 -0400 Received: from localhost (188.28.126.178.threembb.co.uk [188.28.126.178]) by mira.cbaines.net (Postfix) with ESMTPSA id 2407E27BBF1 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 20:03:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 65b3ef86 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 19:02:59 +0000 (UTC) From: Christopher Baines Date: Mon, 19 Oct 2020 20:02:58 +0100 Message-Id: <20201019190259.11356-4-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201019190259.11356-1-mail@cbaines.net> References: <87lfgl3wb7.fsf@gnu.org> <20201019190259.11356-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches So that it can be used, rather than postgresql. Because the major version of the package is important, as it relates to the compatability with the data files used by the service, it's useful to have a stable name to refer to a package for version 10 of PostgreSQL. * gnu/packages/databases.scm (postgresql-10): New variable. --- gnu/packages/databases.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 1236f57018..0d8342b04a 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -1040,6 +1040,8 @@ TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video.") (license (license:x11-style "file://COPYRIGHT")))) +(define-public postgresql-10 postgresql) + (define-public postgresql-11 (package (inherit postgresql) From patchwork Mon Oct 19 19:02:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 24697 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3DF0827BBEE; Mon, 19 Oct 2020 20:04:53 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D80C327BBED for ; Mon, 19 Oct 2020 20:04:52 +0100 (BST) Received: from localhost ([::1]:33212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUaSh-0001ZE-Qd for patchwork@mira.cbaines.net; Mon, 19 Oct 2020 15:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUaRw-0001DH-5u for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUaRv-00011R-T6 for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUaRv-0008GY-Pe for guix-patches@gnu.org; Mon, 19 Oct 2020 15:04:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH v2 5/5] services: databases: Don't specify a default postgresql version. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Oct 2020 19:04:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43771 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43771@debbugs.gnu.org Received: via spool by 43771-submit@debbugs.gnu.org id=B43771.160313419531650 (code B ref 43771); Mon, 19 Oct 2020 19:04:03 +0000 Received: (at 43771) by debbugs.gnu.org; 19 Oct 2020 19:03:15 +0000 Received: from localhost ([127.0.0.1]:42437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaR8-0008EK-T6 for submit@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:15 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUaQw-0008DI-OA for 43771@debbugs.gnu.org; Mon, 19 Oct 2020 15:03:03 -0400 Received: from localhost (188.28.126.178.threembb.co.uk [188.28.126.178]) by mira.cbaines.net (Postfix) with ESMTPSA id 427B427BBF2 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 20:03:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id fc553e56 for <43771@debbugs.gnu.org>; Mon, 19 Oct 2020 19:02:59 +0000 (UTC) From: Christopher Baines Date: Mon, 19 Oct 2020 20:02:59 +0100 Message-Id: <20201019190259.11356-5-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201019190259.11356-1-mail@cbaines.net> References: <87lfgl3wb7.fsf@gnu.org> <20201019190259.11356-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Currently, if the postgresql package major version changes, this is going to break the service upon upgrade, because PostgreSQL will reject the data files from the differing major version of the service. Because it's important to either keep running a particular major version, or intentionally upgrade, I think the configuration would be better with no default. I think this is also going to be helpful when trying to assist users upgrading PostgreSQL. * gnu/services/databases.scm (): Remove default for postgresql. (postgresql-service-type): Remove the default value. * gnu/tests/databases.scm (%postgresql-os): Update accordingly. * gnu/tests/guix.scm (%guix-data-service-os): Update accordingly. * gnu/tests/monitoring.scm (%zabbix-os): Update accordingly. * gnu/tests/web.scm (patchwork-os): Update accordingly. * doc/guix.texi (PostgreSQL): Update accordingly. --- doc/guix.texi | 6 ++++-- gnu/services/databases.scm | 6 ++---- gnu/tests/databases.scm | 4 +++- gnu/tests/guix.scm | 1 + gnu/tests/monitoring.scm | 4 +++- gnu/tests/web.scm | 4 +++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 8aaa896c8d..bc62a1f797 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18184,7 +18184,9 @@ The following example describes a PostgreSQL service with the default configuration. @lisp -(service postgresql-service-type) +(service postgresql-service-type + (postgresql-configuration + (postgresql postgresql-10))) @end lisp If the services fails to start, it may be due to an incompatible @@ -18210,7 +18212,7 @@ Data type representing the configuration for the @code{postgresql-service-type}. @table @asis -@item @var{postgresql} (default: @code{postgresql}) +@item @var{postgresql} PostgreSQL package to use for the service. @item @var{port} (default: @code{5432}) diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm index 7908a3e0f6..d7b4594b9e 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -147,8 +147,7 @@ host all all ::1/128 md5")) (define-record-type* postgresql-configuration make-postgresql-configuration postgresql-configuration? - (postgresql postgresql-configuration-postgresql ; - (default postgresql)) + (postgresql postgresql-configuration-postgresql) ; (port postgresql-configuration-port (default 5432)) (locale postgresql-configuration-locale @@ -279,8 +278,7 @@ host all all ::1/128 md5")) (service-extension account-service-type (const %postgresql-accounts)) (service-extension profile-service-type - (compose list postgresql-configuration-postgresql)))) - (default-value (postgresql-configuration)))) + (compose list postgresql-configuration-postgresql)))))) (define-deprecated (postgresql-service #:key (postgresql postgresql) (port 5432) diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm index e0544bbcd2..d3045cc3f7 100644 --- a/gnu/tests/databases.scm +++ b/gnu/tests/databases.scm @@ -215,7 +215,9 @@ (define %postgresql-os (simple-operating-system - (service postgresql-service-type))) + (service postgresql-service-type + (postgresql-configuration + (postgresql postgresql-10))))) (define (run-postgresql-test) "Run tests in %POSTGRESQL-OS." diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index 20b67d55d3..af7d8f0b21 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -156,6 +156,7 @@ (service dhcp-client-service-type) (service postgresql-service-type (postgresql-configuration + (postgresql postgresql-10) (config-file (postgresql-config-file (hba-file diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm index 17b9edc3ac..7371b02fe1 100644 --- a/gnu/tests/monitoring.scm +++ b/gnu/tests/monitoring.scm @@ -307,7 +307,9 @@ zabbix||{} (let ((base-os (simple-operating-system (service dhcp-client-service-type) - (service postgresql-service-type) + (service postgresql-service-type + (postgresql-configuration + (postgresql postgresql-10))) (service zabbix-front-end-service-type (zabbix-front-end-configuration (db-password "zabbix"))) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 7513eab2e4..7f4518acd2 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -567,7 +567,9 @@ HTTP-PORT." (config (httpd-config-file (listen '("8080")))))) - (service postgresql-service-type) + (service postgresql-service-type + (postgresql-configuration + (postgresql postgresql-10))) (service patchwork-service-type (patchwork-configuration (patchwork patchwork)