services: guix: Depend on 'avahi-daemon' when 'discover?' is set.

Previously, with shepherd 0.10.0, guix-daemon would start quickly,
possibly before avahi-daemon is running.  Consequently, its "guix
discover" child process would exit immediately with a warning saying
"Avahi daemon is not running".

* gnu/services/base.scm (guix-shepherd-service): When DISCOVER? is true,
add 'avahi-daemon' to 'requirement'.
This commit is contained in:
Ludovic Courtès 2023-05-24 12:44:58 +02:00
parent 8b18fa7e07
commit 689460f82a
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1842,7 +1842,8 @@ (define (guix-shepherd-service config)
(list (shepherd-service (list (shepherd-service
(documentation "Run the Guix daemon.") (documentation "Run the Guix daemon.")
(provision '(guix-daemon)) (provision '(guix-daemon))
(requirement '(user-processes)) (requirement `(user-processes
,@(if discover? '(avahi-daemon) '())))
(actions (list shepherd-set-http-proxy-action (actions (list shepherd-set-http-proxy-action
shepherd-discover-action)) shepherd-discover-action))
(modules '((srfi srfi-1) (modules '((srfi srfi-1)