guix-commits
[Top][All Lists]
Advanced

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

07/08: services: avahi: Add #:debug? parameter.


From: Ludovic Courtès
Subject: 07/08: services: avahi: Add #:debug? parameter.
Date: Mon, 27 Jun 2016 21:26:39 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit c8695f325dc96fb54b3a99711533ca8503c677e2
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 27 21:35:46 2016 +0200

    services: avahi: Add #:debug? parameter.
    
    * gnu/services/avahi.scm (<avahi-configuration>)[debug?]: New field.
    (avahi-shepherd-service): Honor it.
    (avahi-service): Add #:debug? and honor it.
    * doc/guix.texi (Networking Services): Adjust accordingly.
---
 doc/guix.texi          |    2 +-
 gnu/services/avahi.scm |   11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 379c9f6..62c0d34 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7767,7 +7767,7 @@ The @code{(gnu services avahi)} provides the following 
definition.
 @deffn {Scheme Procedure} avahi-service [#:avahi @var{avahi}] @
           [#:host-name #f] [#:publish? #t] [#:ipv4? #t] @
           [#:ipv6? #t] [#:wide-area? #f] @
-          [#:domains-to-browse '()]
+          [#:domains-to-browse '()] [#:debug? #f]
 Return a service that runs @command{avahi-daemon}, a system-wide
 mDNS/DNS-SD responder that allows for service discovery and
 "zero-configuration" host name lookups (see @uref{http://avahi.org/}), and
diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm
index 7c3bdab..562005c 100644
--- a/gnu/services/avahi.scm
+++ b/gnu/services/avahi.scm
@@ -42,6 +42,8 @@
   avahi-configuration?
   (avahi             avahi-configuration-avahi    ;<package>
                      (default avahi))
+  (debug?            avahi-configuration-debug?   ;Boolean
+                     (default #f))
   (host-name         avahi-configuration-host-name) ;string
   (publish?          avahi-configuration-publish?)  ;Boolean
   (ipv4?             avahi-configuration-ipv4?)     ;Boolean
@@ -96,6 +98,7 @@
 (define (avahi-shepherd-service config)
   "Return a list of <shepherd-service> for CONFIG."
   (let ((config (configuration-file config))
+        (debug? (avahi-configuration-debug? config))
         (avahi  (avahi-configuration-avahi config)))
     (list (shepherd-service
            (documentation "Run the Avahi mDNS/DNS-SD responder.")
@@ -104,7 +107,9 @@
 
            (start #~(make-forkexec-constructor
                      (list (string-append #$avahi "/sbin/avahi-daemon")
-                           "--daemonize" "-f" #$config)
+                           "--daemonize"
+                           #$@(if debug? #~("--debug") #~())
+                           "-f" #$config)
                      #:pid-file "/var/run/avahi-daemon/pid"))
            (stop #~(make-kill-destructor))))))
 
@@ -128,7 +133,7 @@
                          (service-extension profile-service-type
                                             avahi-package))))))
 
-(define* (avahi-service #:key (avahi avahi)
+(define* (avahi-service #:key (avahi avahi) debug?
                         host-name
                         (publish? #t)
                         (ipv4? #t) (ipv6? #t)
@@ -156,7 +161,7 @@ Boolean values @var{ipv4?} and @var{ipv6?} determine 
whether to use IPv4/IPv6
 sockets."
   (service avahi-service-type
            (avahi-configuration
-            (avahi avahi) (host-name host-name)
+            (avahi avahi) (debug? debug?) (host-name host-name)
             (publish? publish?) (ipv4? ipv4?) (ipv6? ipv6?)
             (wide-area? wide-area?)
             (domains-to-browse domains-to-browse))))



reply via email to

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