guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

139/182: services: hpcguix-web: Delete lock files during activation.


From: guix-commits
Subject: 139/182: services: hpcguix-web: Delete lock files during activation.
Date: Fri, 15 Nov 2019 00:01:56 -0500 (EST)

kkebreau pushed a commit to branch wip-gnome-updates
in repository guix.

commit dc33d5fcfc9f2d69ceb86e47312ec17cf0ca3136
Author: Ludovic Courtès <address@hidden>
Date:   Sat Nov 9 15:12:30 2019 +0100

    services: hpcguix-web: Delete lock files during activation.
    
    * gnu/services/web.scm (%hpcguix-web-activation): Delete ".lock" files
    from HOME-DIR.
---
 gnu/services/web.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index d0c9d0d..3d149a1 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1049,13 +1049,22 @@ a webserver.")
 (define %hpcguix-web-activation
   (with-imported-modules '((guix build utils))
     #~(begin
-        (use-modules (guix build utils))
+        (use-modules (guix build utils)
+                     (ice-9 ftw))
 
         (let ((home-dir "/var/cache/guix/web")
               (user (getpwnam "hpcguix-web")))
           (mkdir-p home-dir)
           (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
   "/var/log/hpcguix-web.log")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]