GNU bug report logs - #48561
"Daemon not running" exception when avahi-daemon is not running

Previous Next

Package: guix;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Fri, 21 May 2021 08:50:02 UTC

Severity: minor

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48561 <at> debbugs.gnu.org
Subject: bug#48561: "Daemon not running" exception when avahi-daemon is not running
Date: Fri, 21 May 2021 15:23:08 +0200
[Message part 1 (text/plain, inline)]
Hello Maxime,

>   warning: avahi daemon is not running, cannot auto-discover substitute servers!

This should be fixed with the attached patch.

Thanks,

Mathieu
[0001-scripts-discover-Warn-when-the-daemon-is-unreachable.patch (text/x-patch, inline)]
From a50bbf99f65d26bbdb0d16112a49335bf913b822 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe <at> gnu.org>
Date: Fri, 21 May 2021 15:21:15 +0200
Subject: [PATCH] scripts: discover: Warn when the daemon is unreachable.

* guix/scripts/discover (guix-discover): Print a warning message when the
daemon is unreachable.
---
 guix/scripts/discover.scm | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/discover.scm b/guix/scripts/discover.scm
index be1eaa6e95..e42f7662d0 100644
--- a/guix/scripts/discover.scm
+++ b/guix/scripts/discover.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2020 Mathieu Othacehe <othacehe <at> gnu.org>
+;;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe <at> gnu.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -26,6 +26,7 @@
   #:use-module (guix build syscalls)
   #:use-module (guix build utils)
   #:use-module (guix scripts publish)
+  #:use-module (avahi)
   #:use-module (ice-9 rdelim)
   #:use-module (srfi srfi-37)
   #:export (read-substitute-urls
@@ -138,5 +139,13 @@ to synchronize with the writer."
       (parameterize ((%publish-file publish-file))
         (mkdir-p (dirname publish-file))
         (false-if-exception (delete-file publish-file))
-        (avahi-browse-service-thread service-proc
-                                     #:types %services)))))
+        (catch 'avahi-error
+          (lambda ()
+            (avahi-browse-service-thread service-proc
+                                         #:types %services))
+          (lambda (key err function . _)
+            (cond
+             ((eq? err error/no-daemon)
+              (warning (G_ "Avahi daemon is not running, \
+cannot auto-discover substitutes servers.~%"))))
+            (exit 1)))))))
-- 
2.31.1


This bug report was last modified 4 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.