guix-commits
[Top][All Lists]
Advanced

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

05/06: services: nscd-service: Add #:name-services parameter.


From: Ludovic Courtès
Subject: 05/06: services: nscd-service: Add #:name-services parameter.
Date: Wed, 04 Feb 2015 21:49:51 +0000

civodul pushed a commit to branch master
in repository guix.

commit 4aee6e60033786e1fa09595f116199a17516e64e
Author: Ludovic Courtès <address@hidden>
Date:   Wed Feb 4 22:42:38 2015 +0100

    services: nscd-service: Add #:name-services parameter.
    
    * gnu/services/base.scm (nscd-service): Add #:name-services parameter.
      In 'start' field, set LD_LIBRARY_PATH based on #:name-services.
    * doc/guix.texi (Base Services): Document it.
      (Name Service Switch): Link to 'nscd-service'.
---
 doc/guix.texi         |   14 +++++++++++---
 gnu/services/base.scm |   17 ++++++++++++++---
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index e489d41..bd985f9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4319,9 +4319,12 @@ the ``message of the day''.
 
 @cindex name service cache daemon
 @cindex nscd
address@hidden {Monadic Procedure} nscd-service address@hidden [#:glibc glibc]
-Return a service that runs libc's name service cache daemon (nscd) with the
-given @var{config}---an @code{<nscd-configuration>} object.
address@hidden {Monadic 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.
 @end deffn
 
 @defvr {Scheme Variable} %nscd-default-configuration
@@ -4753,6 +4756,11 @@ associated lookup action.
 A string denoting the name service (@pxref{Services in the NSS
 configuration,,, libc, The GNU C Library Reference Manual}).
 
+Note that name services listed here must be visible to nscd.  This is
+achieved by passing the @code{#:name-services} argument to
address@hidden the list of packages providing the needed name
+services (@pxref{Base Services, @code{nscd-service}}).
+
 @item reaction
 An action specified using the @code{lookup-specification} macro
 (@pxref{Actions in the NSS configuration,,, libc, The GNU C Library
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 32eb903..94abef6 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -492,9 +492,12 @@ the ``message of the day''."
                                 (map cache->config caches)))))))
 
 (define* (nscd-service #:optional (config %nscd-default-configuration)
-                       #:key (glibc (canonical-package glibc)))
+                       #:key (glibc (canonical-package 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."
+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."
   (mlet %store-monad ((nscd.conf (nscd.conf-file config)))
     (return (service
              (documentation "Run libc's name service cache daemon (nscd).")
@@ -507,7 +510,15 @@ given @var{config}---an @code{<nscd-configuration>} 
object."
 
              (start #~(make-forkexec-constructor
                        (list (string-append #$glibc "/sbin/nscd")
-                             "-f" #$nscd.conf "--foreground")))
+                             "-f" #$nscd.conf "--foreground")
+
+                       #:environment-variables
+                       (list (string-append "LD_LIBRARY_PATH="
+                                            (string-join
+                                             (map (lambda (dir)
+                                                    (string-append dir "/lib"))
+                                                  (list address@hidden))
+                                             ":")))))
              (stop #~(make-kill-destructor))
 
              (respawn? #f)))))



reply via email to

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