guix-commits
[Top][All Lists]
Advanced

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

03/10: installer: Log important bits to syslog.


From: guix-commits
Subject: 03/10: installer: Log important bits to syslog.
Date: Wed, 19 Feb 2020 17:48:47 -0500 (EST)

civodul pushed a commit to branch wip-installer-test
in repository guix.

commit 1d87b66c9ff09afe00b4c24165719763b0781b19
Author: Ludovic Courtès <address@hidden>
AuthorDate: Wed Feb 19 12:08:40 2020 +0100

    installer: Log important bits to syslog.
    
    * gnu/installer.scm (installer-program): Log crashes with 'syslog'.
    * gnu/installer/steps.scm (run-installer-steps): Log the running step
    with 'syslog'.
    * gnu/installer/utils.scm (run-shell-command): Add calls to 'syslog'.
---
 gnu/installer.scm       | 5 ++++-
 gnu/installer/steps.scm | 1 +
 gnu/installer/utils.scm | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/installer.scm b/gnu/installer.scm
index 3f4ae4b..edef3fd 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018, 2020 Mathieu Othacehe <address@hidden>
-;;; Copyright © 2019 Ludovic Courtès <address@hidden>
+;;; Copyright © 2019, 2020 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -26,6 +26,7 @@
   #:use-module (guix utils)
   #:use-module (guix ui)
   #:use-module ((guix self) #:select (make-config.scm))
+  #:use-module (gnu installer utils)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
@@ -395,6 +396,8 @@ selected keymap."
                      #f)))
                 (const #f)
                 (lambda (key . args)
+                  (syslog "crashing due to uncaught exception: ~s ~s~%"
+                          key args)
                   (let ((error-file "/tmp/last-installer-error"))
                     (call-with-output-file error-file
                       (lambda (port)
diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm
index 4e90f32..b2fc819 100644
--- a/gnu/installer/steps.scm
+++ b/gnu/installer/steps.scm
@@ -177,6 +177,7 @@ return the accumalated result so far."
                               #:done-steps '())))))
                  ((installer-step-break? c)
                   (reverse result)))
+         (syslog "running step '~a'~%" (installer-step-id step))
          (let* ((id (installer-step-id step))
                 (compute (installer-step-compute step))
                 (res (compute result done-steps)))
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index a5f390e..842bd02 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -89,9 +89,13 @@ COMMAND exited successfully, #f otherwise."
                 (format (current-error-port)
                         (G_ "Command failed with exit code ~a.~%")
                         (invoke-error-exit-status c))
+                (syslog "command ~s failed with exit code ~a"
+                        command (invoke-error-exit-status c))
                 (pause)
                 #f))
+       (syslog "running command ~s~%" command)
        (invoke "bash" "--init-file" file)
+       (syslog "command ~s succeeded~%" command)
        (newline)
        (pause)
        #t))))



reply via email to

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