mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 22:38:07 -05:00
services: hpcguix-web: Delete lock files during activation.
* gnu/services/web.scm (%hpcguix-web-activation): Delete ".lock" files from HOME-DIR.
This commit is contained in:
parent
1ce0d7e190
commit
7c34c62c80
1 changed files with 11 additions and 2 deletions
|
@ -1049,13 +1049,22 @@ (define %hpcguix-web-accounts
|
||||||
(define %hpcguix-web-activation
|
(define %hpcguix-web-activation
|
||||||
(with-imported-modules '((guix build utils))
|
(with-imported-modules '((guix build utils))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils)
|
||||||
|
(ice-9 ftw))
|
||||||
|
|
||||||
(let ((home-dir "/var/cache/guix/web")
|
(let ((home-dir "/var/cache/guix/web")
|
||||||
(user (getpwnam "hpcguix-web")))
|
(user (getpwnam "hpcguix-web")))
|
||||||
(mkdir-p home-dir)
|
(mkdir-p home-dir)
|
||||||
(chown home-dir (passwd:uid user) (passwd:gid user))
|
(chown home-dir (passwd:uid user) (passwd:gid user))
|
||||||
(chmod home-dir #o755)))))
|
(chmod home-dir #o755)
|
||||||
|
|
||||||
|
;; Remove stale 'packages.json.lock' file (and other lock files, if
|
||||||
|
;; any) since that would prevent 'packages.json' from being updated.
|
||||||
|
(for-each (lambda (lock)
|
||||||
|
(delete-file (string-append home-dir "/" lock)))
|
||||||
|
(scandir home-dir
|
||||||
|
(lambda (file)
|
||||||
|
(string-suffix? ".lock" file))))))))
|
||||||
|
|
||||||
(define %hpcguix-web-log-file
|
(define %hpcguix-web-log-file
|
||||||
"/var/log/hpcguix-web.log")
|
"/var/log/hpcguix-web.log")
|
||||||
|
|
Loading…
Reference in a new issue