summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <christopher.baines@digital.cabinet-office.gov.uk>2016-11-14 16:34:56 +0000
committerChristopher Baines <christopher.baines@digital.cabinet-office.gov.uk>2016-11-14 16:34:56 +0000
commita3d744bbb877f9a1481448569286bfae8a1741f7 (patch)
tree15994afc385744e93343dab60dbcbf88f57bc85c
parent04ab2b2888a169030c68ca77177fc9a9bba022bb (diff)
downloadgnu-guix-spike-end-to-end-test-system.tar
gnu-guix-spike-end-to-end-test-system.tar.gz
Enable specifying a custom PostgreSQL portspike-end-to-end-test-system
-rw-r--r--gnu/services/databases.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index aace9554f7..c4416764e4 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -48,6 +48,8 @@
postgresql-configuration?
(postgresql postgresql-configuration-postgresql ;<package>
(default postgresql))
+ (port postgresql-configuration-port
+ (default 5432))
(config-file postgresql-configuration-file)
(data-directory postgresql-configuration-data-directory))
@@ -80,7 +82,7 @@ host all all ::1/128 trust"))
(define postgresql-activation
(match-lambda
- (($ <postgresql-configuration> postgresql config-file data-directory)
+ (($ <postgresql-configuration> postgresql port config-file data-directory)
#~(begin
(use-modules (guix build utils)
(ice-9 match))
@@ -108,7 +110,7 @@ host all all ::1/128 trust"))
(define postgresql-shepherd-service
(match-lambda
- (($ <postgresql-configuration> postgresql config-file data-directory)
+ (($ <postgresql-configuration> postgresql port config-file data-directory)
(let ((start-script
;; Wrapper script that switches to the 'postgres' user before
;; launching daemon.
@@ -121,6 +123,7 @@ host all all ::1/128 trust"))
(system* postgres
(string-append "--config-file="
#$config-file)
+ "-p" #$port
"-D" #$data-directory)))))
(list (shepherd-service
(provision '(postgres))
@@ -140,6 +143,7 @@ host all all ::1/128 trust"))
(const %postgresql-accounts))))))
(define* (postgresql-service #:key (postgresql postgresql)
+ (port 5432)
(config-file %default-postgres-config)
(data-directory "/var/lib/postgresql/data"))
"Return a service that runs @var{postgresql}, the PostgreSQL database server.
@@ -149,6 +153,7 @@ and stores the database cluster in @var{data-directory}."
(service postgresql-service-type
(postgresql-configuration
(postgresql postgresql)
+ (port port)
(config-file config-file)
(data-directory data-directory))))