aboutsummaryrefslogtreecommitdiff
path: root/gn/services
diff options
context:
space:
mode:
authorArun Isaac2022-08-22 14:38:53 +0530
committerArun Isaac2022-08-22 14:38:53 +0530
commit0fb45ae725fc871aeb66c18b15c67c11703142d3 (patch)
treea15479cd0bd6fe3918cfea7a6ff17752651a92e7 /gn/services
parentbfde1a0453b1ba49111e708f72c1bc6d6ed63603 (diff)
downloadguix-bioinformatics-0fb45ae725fc871aeb66c18b15c67c11703142d3.tar.gz
Set permissions on virtuoso state directory.
* gn/services/databases.scm (virtuoso-activation): New function. (virtuoso-service-type): Extend activation-service-type with virtuoso-activation.
Diffstat (limited to 'gn/services')
-rw-r--r--gn/services/databases.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/gn/services/databases.scm b/gn/services/databases.scm
index 4eab8f3..0f4eeba 100644
--- a/gn/services/databases.scm
+++ b/gn/services/databases.scm
@@ -42,6 +42,18 @@
(http-server-port virtuoso-configuration-http-server-port
(default 8890)))
+(define (virtuoso-activation config)
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+
+ (for-each (lambda (file)
+ (chown file
+ (passwd:uid (getpw "virtuoso"))
+ (passwd:gid (getpw "virtuoso"))))
+ (find-files #$(virtuoso-configuration-state-directory config)
+ #:directories? #t)))))
+
(define %virtuoso-accounts
(list (user-group (name "virtuoso")
(system? #t))
@@ -96,7 +108,9 @@
(name 'virtuoso)
(description "Run Virtuoso.")
(extensions
- (list (service-extension account-service-type
+ (list (service-extension activation-service-type
+ virtuoso-activation)
+ (service-extension account-service-type
(const %virtuoso-accounts))
(service-extension shepherd-root-service-type
(compose list virtuoso-shepherd-service))))