From patchwork Fri Oct 2 18:40: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: 24445 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 ED03427BBE9; Fri, 2 Oct 2020 19:42:31 +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 C97C827BBE8 for ; Fri, 2 Oct 2020 19:42:31 +0100 (BST) Received: from localhost ([::1]:38354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0l-0000lt-10 for patchwork@mira.cbaines.net; Fri, 02 Oct 2020 14:42:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0K-0000UD-OW for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0J-0002LM-OG for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0J-0002nV-MK for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 1/5] Replace (postgresql-service) with (service postgresql-service-type) References: <87lfgo1nlv.fsf@cbaines.net> In-Reply-To: <87lfgo1nlv.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42: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.160166406710660 (code B ref 43771); Fri, 02 Oct 2020 18:42:03 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:07 +0000 Received: from localhost ([127.0.0.1]:42572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzP-0002lr-10 for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:07 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002kn-SV for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:04 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id F1FCB27BBE8 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:01 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 367ef504 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:55 +0100 Message-Id: <20201002184059.29033-1-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 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 | 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 Fri Oct 2 18:40: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: 24444 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 A4D1827BBE9; Fri, 2 Oct 2020 19:42:20 +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 39E1827BBE8 for ; Fri, 2 Oct 2020 19:42:20 +0100 (BST) Received: from localhost ([::1]:37782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0Z-0000VO-DI for patchwork@mira.cbaines.net; Fri, 02 Oct 2020 14:42:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0000Tw-TQ for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0002L9-KL for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0I-0002n9-ID for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 2/5] Add some subheadings in to the Databases section of the docs Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42: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.160166406510638 (code B ref 43771); Fri, 02 Oct 2020 18:42:02 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:05 +0000 Received: from localhost ([127.0.0.1]:42566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzM-0002lQ-T4 for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:05 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002kr-RQ for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:03 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id 19F2B27BBE9 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 1253e086 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:56 +0100 Message-Id: <20201002184059.29033-2-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184059.29033-1-mail@cbaines.net> References: <20201002184059.29033-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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 79c79b6a96..4197cd562a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17736,6 +17736,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 '()] @@ -17801,6 +17803,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. @@ -17825,6 +17829,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 @@ -17857,6 +17863,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. @@ -17883,6 +17891,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 Fri Oct 2 18:40: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: 24443 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 5597127BBEA; Fri, 2 Oct 2020 19:42:20 +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 C90DF27BBE9 for ; Fri, 2 Oct 2020 19:42:19 +0100 (BST) Received: from localhost ([::1]:37746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0Y-0000UR-Ug for patchwork@mira.cbaines.net; Fri, 02 Oct 2020 14:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0J-0000U4-GR for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0002LG-Vj for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0I-0002nH-UJ for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 3/5] Remove the postgresql-service procedure Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42: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.160166406510645 (code B ref 43771); Fri, 02 Oct 2020 18:42:02 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:05 +0000 Received: from localhost ([127.0.0.1]:42568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzN-0002lX-8G for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:05 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002ko-Rx for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:03 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id 2B24C27BBEA for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 61143908 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:57 +0100 Message-Id: <20201002184059.29033-3-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184059.29033-1-mail@cbaines.net> References: <20201002184059.29033-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 It's unnecessary, using the service type directly is a better approach. While this is unfortunately a breaking change, I'm also looking at making breaking changes to the service type configuration, so I don't think this can be avoided. --- doc/guix.texi | 40 +++++++++++++++++++++++++++++--------- gnu/services/databases.scm | 19 ------------------ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4197cd562a..641b410acf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17738,15 +17738,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 @@ -17766,6 +17763,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, @@ -17801,7 +17821,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..efad182a68 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -281,25 +281,6 @@ 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 '())) - "Return a service that runs @var{postgresql}, the PostgreSQL database server. - -The PostgreSQL daemon loads its runtime configuration from @var{config-file} -and stores the database cluster in @var{data-directory}." - (service postgresql-service-type - (postgresql-configuration - (postgresql postgresql) - (port port) - (locale locale) - (config-file config-file) - (data-directory data-directory) - (extension-packages extension-packages)))) - ;;; ;;; Memcached From patchwork Fri Oct 2 18:40: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: 24442 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 0EEF827BBEA; Fri, 2 Oct 2020 19:42:20 +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 C23C527BBE8 for ; Fri, 2 Oct 2020 19:42:19 +0100 (BST) Received: from localhost ([::1]:37748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0Y-0000UU-Ue for patchwork@mira.cbaines.net; Fri, 02 Oct 2020 14:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0000Tn-Gf for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59259) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0I-0002L5-6X for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0I-0002n2-25 for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 4/5] Define postgresql-10 Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42: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.160166406510631 (code B ref 43771); Fri, 02 Oct 2020 18:42:02 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:05 +0000 Received: from localhost ([127.0.0.1]:42564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzM-0002lN-M9 for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:04 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002kp-RW for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:03 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id 4104727BBEB for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id d8151417 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:58 +0100 Message-Id: <20201002184059.29033-4-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184059.29033-1-mail@cbaines.net> References: <20201002184059.29033-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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index ece4580c36..8cab3eb115 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -1038,6 +1038,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 Fri Oct 2 18:40: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: 24446 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 A6D9C27BBE9; Fri, 2 Oct 2020 19:42:33 +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 540C627BBE8 for ; Fri, 2 Oct 2020 19:42:33 +0100 (BST) Received: from localhost ([::1]:38398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOQ0m-0000mo-Hl for patchwork@mira.cbaines.net; Fri, 02 Oct 2020 14:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOQ0K-0000UE-OU for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOQ0J-0002LJ-B5 for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kOQ0J-0002nO-9w for guix-patches@gnu.org; Fri, 02 Oct 2020 14:42:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43771] [PATCH 5/5] Don't specify a default postgresql version to use for the service Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 02 Oct 2020 18:42: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.160166406610652 (code B ref 43771); Fri, 02 Oct 2020 18:42:03 +0000 Received: (at 43771) by debbugs.gnu.org; 2 Oct 2020 18:41:06 +0000 Received: from localhost ([127.0.0.1]:42570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzN-0002le-Ll for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:05 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPzK-0002ks-S1 for 43771@debbugs.gnu.org; Fri, 02 Oct 2020 14:41:04 -0400 Received: from localhost (188.28.111.33.threembb.co.uk [188.28.111.33]) by mira.cbaines.net (Postfix) with ESMTPSA id 55D3027BBEC for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 19:41:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id b89fd893 for <43771@debbugs.gnu.org>; Fri, 2 Oct 2020 18:40:59 +0000 (UTC) From: Christopher Baines Date: Fri, 2 Oct 2020 19:40:59 +0100 Message-Id: <20201002184059.29033-5-mail@cbaines.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002184059.29033-1-mail@cbaines.net> References: <20201002184059.29033-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. --- 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 641b410acf..4ce0072ed4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17742,7 +17742,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 @@ -17768,7 +17770,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 efad182a68..96d2dc4935 100644 --- a/gnu/services/databases.scm +++ b/gnu/services/databases.scm @@ -146,8 +146,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 @@ -278,8 +277,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)))))) ;;; 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 6139e31cf0..ebee8d43af 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -83,6 +83,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)