From 0fb45ae725fc871aeb66c18b15c67c11703142d3 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 22 Aug 2022 14:38:53 +0530 Subject: Set permissions on virtuoso state directory. * gn/services/databases.scm (virtuoso-activation): New function. (virtuoso-service-type): Extend activation-service-type with virtuoso-activation. --- gn/services/databases.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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)))) -- cgit v1.2.3