summary refs log tree commit diff
path: root/gnu/installer/final.scm
diff options
context:
space:
mode:
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.