guix-commits
[Top][All Lists]
Advanced

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

07/12: services: nscd-service: Fit everything into <nscd-configuration>.


From: Ludovic Courtès
Subject: 07/12: services: nscd-service: Fit everything into <nscd-configuration>.
Date: Thu, 08 Oct 2015 21:47:31 +0000

civodul pushed a commit to branch wip-service-refactor
in repository guix.

commit d7edb4ef7bfd6d532299ba53ee6193e3a426b3e1
Author: Ludovic Courtès <address@hidden>
Date:   Sun Sep 13 12:43:28 2015 +0200

    services: nscd-service: Fit everything into <nscd-configuration>.
    
    * gnu/services/base.scm (<nscd-configuration>)[glibc, name-services]:
      New fields.
      (nscd-service): Remove #:glibc and #:name-services parameters.  Adjust
      body to take those from CONFIG.
    * gnu/services/desktop.scm (%desktop-services): Adjust accordingly.
    * doc/guix.texi (Base Services): Adjust accordingly.
      (Name Service Switch): Adjust example.
---
 doc/guix.texi            |   20 +++++++++++++-------
 gnu/services/base.scm    |   22 +++++++++++++---------
 gnu/services/desktop.scm |    4 ++--
 3 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a3a8a30..03266a2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5799,11 +5799,9 @@ The Mingetty package to use.
 @cindex nscd
 @deffn {Scheme Procedure} nscd-service address@hidden [#:glibc glibc] @
                 [#:name-services '()]
-Return a service that runs libc's name service cache daemon (nscd) with
-the given @var{config}---an @code{<nscd-configuration>} object.
-Optionally, @code{#:name-services} is a list of packages that provide
-name service switch (NSS) modules needed by nscd.  @xref{Name Service
-Switch}, for an example.
+Return a service that runs libc's name service cache daemon (nscd) with the
+given @var{config}---an @code{<nscd-configuration>} object.  @xref{Name
+Service Switch}, for an example.
 @end deffn
 
 @defvr {Scheme Variable} %nscd-default-configuration
@@ -5818,6 +5816,14 @@ configuration.
 
 @table @asis
 
address@hidden @code{name-services} (default: @code{'()})
+List of packages denoting @dfn{name services} that must be visible to
+the nscd---e.g., @code{(list @var{nss-mdns})}.
+
address@hidden @code{glibc} (default: @var{glibc})
+Package object denoting the GNU C Library providing the @command{nscd}
+command.
+
 @item @code{log-file} (default: @code{"/var/log/nscd.log"})
 Name of nscd's log file.  This is where debugging output goes when
 @code{debug-level} is strictly positive.
@@ -6546,8 +6552,8 @@ configuration file:
   ;; about nss-mdns.
   (map (lambda (service)
          (if (member 'nscd (service-provision service))
-             (nscd-service (nscd-configuration)
-                           #:name-services (list nss-mdns))
+             (nscd-service (nscd-configuration
+                             (name-services (list nss-mdns))))
              service))
        %base-services))
 @end example
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 0b4bd7e..d9d73b4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -412,7 +412,11 @@ other things."
                (default 0))
   ;; TODO: See nscd.conf in glibc for other options to add.
   (caches     nscd-configuration-caches           ;list of <nscd-cache>
-              (default %nscd-default-caches)))
+              (default %nscd-default-caches))
+  (name-services nscd-configuration-name-services ;list of <packages>
+                 (default '()))
+  (glibc      nscd-configuration-glibc            ;<package>
+              (default (canonical-package glibc))))
 
 (define-record-type* <nscd-cache> nscd-cache make-nscd-cache
   nscd-cache?
@@ -502,13 +506,10 @@ other things."
                                 (string-concatenate
                                  (map cache->config caches)))))))
 
-(define* (nscd-service #:optional (config %nscd-default-configuration)
-                       #:key (glibc (canonical-package glibc))
-                       (name-services '()))
+(define* (nscd-service #:optional (config %nscd-default-configuration))
   "Return a service that runs libc's name service cache daemon (nscd) with the
-given @var{config}---an @code{<nscd-configuration>} object.  Optionally,
address@hidden:name-services} is a list of packages that provide name service 
switch
- (NSS) modules needed by nscd.  @xref{Name Service Switch}, for an example."
+given @var{config}---an @code{<nscd-configuration>} object.  @xref{Name
+Service Switch}, for an example."
   (let ((nscd.conf (nscd.conf-file config)))
     (service
      (documentation "Run libc's name service cache daemon (nscd).")
@@ -521,7 +522,8 @@ given @var{config}---an @code{<nscd-configuration>} object. 
 Optionally,
                    (mkdir-p "/var/db/nscd")))     ;for the persistent cache
 
      (start #~(make-forkexec-constructor
-               (list (string-append #$glibc "/sbin/nscd")
+               (list (string-append #$(nscd-configuration-glibc config)
+                                    "/sbin/nscd")
                      "-f" #$nscd.conf "--foreground")
 
                #:environment-variables
@@ -529,7 +531,9 @@ given @var{config}---an @code{<nscd-configuration>} object. 
 Optionally,
                                     (string-join
                                      (map (lambda (dir)
                                             (string-append dir "/lib"))
-                                          (list address@hidden))
+                                          (list
+                                           #$@(nscd-configuration-name-services
+                                               config)))
                                      ":")))))
      (stop #~(make-kill-destructor))
 
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 35b1914..346f916 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -594,8 +594,8 @@ when they log out."
                 (cond
                  ;; Provide an nscd ready to use nss-mdns.
                  ((memq 'nscd (service-provision service))
-                  (nscd-service (nscd-configuration)
-                                #:name-services (list nss-mdns)))
+                  (nscd-service (nscd-configuration
+                                 (name-services (list nss-mdns)))))
 
                  ;; Add more rules to udev-service.
                  ;;



reply via email to

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