summary refs log tree commit diff
path: root/gnu/installer/final.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-14 16:24:34 +0200
committerMarius Bakke <marius@gnu.org>2020-06-14 16:24:34 +0200
commit4193095e18b602705df94e38a8d60ef1fe380e49 (patch)
tree2500f31bcfae9b4cb5a23d633395f6892a7bd8a7 /gnu/installer/final.scm
parenta48a3f0640d76cb5e5945557c9aae6dabce39d93 (diff)
parente88745a655b220b4047f7db5175c828ef9c33e11 (diff)
downloadguix-4193095e18b602705df94e38a8d60ef1fe380e49.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/installer/final.scm')
-rw-r--r--gnu/installer/final.scm22
1 files changed, 19 insertions, 3 deletions
diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 4c2da484c9..a742c2a0cd 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -127,8 +127,8 @@ USERS."
                    (lambda (port)
                      (match (string-tokenize (read-string port) %not-nul)
                        ((argv0 _ ...)
-                        (unless (member (pk (basename argv0)) spare)
-                          (syslog "Killing process ~a~%" pid)
+                        (unless (member (basename argv0) spare)
+                          (syslog "Killing process ~a (~a)~%" pid argv0)
                           (kill pid SIGKILL)))
                        (_ #f))))))
               pids)))
@@ -146,6 +146,8 @@ be much appreciated."
   (catch #t
     (lambda ()
       (let ((tmp-dir "/remove"))
+        (syslog "Unmounting cow-store.~%")
+
         (mkdir-p tmp-dir)
         (mount (%store-directory) tmp-dir "" MS_MOVE)
 
@@ -153,6 +155,8 @@ be much appreciated."
         ;; restart it.
         (restart-service 'guix-daemon)
 
+        (syslog "Killing cow users.")
+
         ;; Kill all processes started while the cow-store was active (logins
         ;; on other TTYs for instance).
         (kill-cow-users tmp-dir)
@@ -160,6 +164,7 @@ be much appreciated."
         ;; Try to umount the store overlay. Some process such as udevd
         ;; workers might still be active, so do some retries.
         (let loop ((try 5))
+          (syslog "Umount try ~a~%" (- 5 try))
           (sleep 1)
           (let ((umounted? (false-if-exception (umount tmp-dir))))
             (if (and (not umounted?) (> try 0))
@@ -203,7 +208,18 @@ or #f.  Return #t on success and #f on failure."
       (lambda ()
         (start-service 'cow-store (list (%installer-target-dir))))
       (lambda ()
-        (run-command install-command #:locale locale))
+        ;; If there are any connected clients, assume that we are running
+        ;; installation tests. In that case, dump the standard and error
+        ;; outputs to syslog.
+        (if (not (null? (current-clients)))
+            (with-output-to-file "/dev/console"
+              (lambda ()
+                (with-error-to-file "/dev/console"
+                  (lambda ()
+                    (setvbuf (current-output-port) 'none)
+                    (setvbuf (current-error-port) 'none)
+                    (run-command install-command #:locale locale)))))
+            (run-command install-command #:locale locale)))
       (lambda ()
         (stop-service 'cow-store)
         ;; Remove the store overlay created at cow-store service start.