unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 48561@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	[thread overview]
Message-ID: <87im3cqkzn.fsf@gnu.org> (raw)
In-Reply-To: <2d3636af080e6bcddc6ba94dc162260c0e73ed54.camel@telenet.be> (Maxime Devos's message of "Fri, 21 May 2021 10:48:53 +0200")

[-- Attachment #1: Type: text/plain, Size: 164 bytes --]


Hello Maxime,

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

This should be fixed with the attached patch.

Thanks,

Mathieu

[-- Attachment #2: 0001-scripts-discover-Warn-when-the-daemon-is-unreachable.patch --]
[-- Type: text/x-patch, Size: 1930 bytes --]

From a50bbf99f65d26bbdb0d16112a49335bf913b822 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@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@gnu.org>
+;;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@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


  reply	other threads:[~2021-05-21 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21  8:48 bug#48561: "Daemon not running" exception when avahi-daemon is not running Maxime Devos
2021-05-21 13:23 ` Mathieu Othacehe [this message]
2021-05-21 14:37   ` Maxime Devos
2021-05-22 12:06     ` Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im3cqkzn.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=48561@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).