aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/databases.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-03-05 22:56:40 +0000
committerChristopher Baines <mail@cbaines.net>2021-03-06 00:18:30 +0000
commita8448da0f4a090818104e64dd79f90b0e50d5e77 (patch)
tree494c58b4724f12cd9de0db9b0a7096de2b922c0f /gnu/services/databases.scm
parent4f4b749e75b38b8c08b4f67ef51c2c8740999e28 (diff)
parenta714af38d5d1046081524d859cde4cd8fd12a923 (diff)
downloadguix-a8448da0f4a090818104e64dd79f90b0e50d5e77.tar
guix-a8448da0f4a090818104e64dd79f90b0e50d5e77.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/services/databases.scm')
-rw-r--r--gnu/services/databases.scm25
1 files changed, 13 insertions, 12 deletions
diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index d908b86af8..979f3dd6c8 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -331,7 +331,9 @@ host all all ::1/128 md5"))
(const %postgresql-accounts))
(service-extension
profile-service-type
- (compose list postgresql-configuration-postgresql))))))
+ (compose list postgresql-configuration-postgresql))))
+ (default-value (postgresql-configuration
+ (postgresql postgresql-10)))))
(define-deprecated (postgresql-service #:key (postgresql postgresql)
(port 5432)
@@ -408,13 +410,8 @@ rolname = '" ,name "')) as not_exists;\n"
(let ((host (postgresql-role-configuration-host config))
(roles (postgresql-role-configuration-roles config)))
- (program-file
- "postgresql-create-roles"
- #~(begin
- (let ((psql #$(file-append postgresql "/bin/psql")))
- (execl psql psql "-a"
- "-h" #$host
- "-f" #$(roles->queries roles)))))))
+ #~(let ((psql #$(file-append postgresql "/bin/psql")))
+ (list psql "-a" "-h" #$host "-f" #$(roles->queries roles)))))
(define (postgresql-role-shepherd-service config)
(match-record config <postgresql-role-configuration>
@@ -423,10 +420,14 @@ rolname = '" ,name "')) as not_exists;\n"
(requirement '(postgres))
(provision '(postgres-roles))
(one-shot? #t)
- (start #~(make-forkexec-constructor
- (list #$(postgresql-create-roles config))
- #:user "postgres" #:group "postgres"
- #:log-file #$log))
+ (start
+ #~(lambda args
+ (let ((pid (fork+exec-command
+ #$(postgresql-create-roles config)
+ #:user "postgres"
+ #:group "postgres"
+ #:log-file #$log)))
+ (zero? (cdr (waitpid pid))))))
(documentation "Create PostgreSQL roles.")))))
(define postgresql-role-service-type