aboutsummaryrefslogtreecommitdiff
path: root/gn/services
diff options
context:
space:
mode:
authorEfraim Flashner2019-12-24 03:28:49 -0600
committerEfraim Flashner2019-12-24 03:28:49 -0600
commitca7beb74e1aae5c1f9e44d5da9f44143467d253b (patch)
tree00862658352883b95f7c5db5489ecef5546604d6 /gn/services
parent49415a72997507597342f8e9ca2281042d3cba3b (diff)
downloadguix-bioinformatics-ca7beb74e1aae5c1f9e44d5da9f44143467d253b.tar.gz
update BNW and service
Diffstat (limited to 'gn/services')
-rw-r--r--gn/services/bnw-container.scm12
-rw-r--r--gn/services/bnw.service2
2 files changed, 7 insertions, 7 deletions
diff --git a/gn/services/bnw-container.scm b/gn/services/bnw-container.scm
index 2e5e521..c896020 100644
--- a/gn/services/bnw-container.scm
+++ b/gn/services/bnw-container.scm
@@ -13,7 +13,7 @@
(package bnw-configuration-package ; package
(default bnw))
(deploy-directory bnw-deploy-directory ; string
- (default "/home/bnw/server"))
+ (default "/srv/http"))
(port bnw-configuration-port ; list of strings
(default '("8880"))))
@@ -23,11 +23,12 @@
#~(begin
(use-modules (guix build utils))
(when (directory-exists? #$deploy-directory)
- (delete-file-recusively #$deploy-directory))
+ ;; Not 'delete-file-recursively' because the directory might be empty.
+ (system* "rm" "-r" #$(string-append deploy-directory "/*")))
(mkdir-p #$deploy-directory)
(copy-recursively #$package #$deploy-directory)
- (system* #$(file-append coreutils "/bin/chmod") "a+w"
- (string-append #$deploy-directory "/sourcecodes/data"))))))
+ (invoke #$(file-append coreutils "/bin/chmod") "a+w"
+ (string-append #$deploy-directory "/sourcecodes/data"))))))
(define bnw-nginx-config
(match-lambda
@@ -37,7 +38,7 @@
(server-name '("Bayesian Network"))
(listen port)
;(root package)
- (root "/srv/http")
+ (root deploy-directory)
(locations
(list
(nginx-php-location)
@@ -81,6 +82,5 @@
(service bnw-service-type
;; The following is for testing:
;(bnw-configuration
- ; (deploy-directory "/home/efraimf/bnw")
; (port '("8888")))
))))
diff --git a/gn/services/bnw.service b/gn/services/bnw.service
index ec7b3f8..5ba8f3f 100644
--- a/gn/services/bnw.service
+++ b/gn/services/bnw.service
@@ -3,7 +3,7 @@ Description=BNW web server
Wants=guix-daemon.service
[Service]
-Environment="BNW_COMMAND=$(/bin/su -l bnw -c '/var/guix/profiles/per-user/bnw/current-guix/bin/guix system container /home/bnw/guix-bioinformatics/gn/services/bnw-container.scm --share=/home/bnw/server=/srv/http --network')"
+Environment="BNW_COMMAND=$(/bin/su -l bnw -c '/var/guix/profiles/per-user/bnw/current-guix/bin/guix system container /home/bnw/guix-bioinformatics/gn/services/bnw-container.scm --share=/home/bnw/server=/srv/http --share=/home/bnw/server/var-log=/var/log --network')"
ExecStart=/bin/bash -c '${BNW_COMMAND}'
[Install]