summaryrefslogtreecommitdiff
path: root/gnu/services/base.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-09-13 12:43:28 +0200
committerLudovic Courtès <ludo@gnu.org>2015-10-10 22:46:14 +0200
commitb893f1aec35b879169f80bc9461fac21907fbaf4 (patch)
tree2b03bbb031142578d71c469bd9b0f6a1f425db7b /gnu/services/base.scm
parent66e4f01c601bfad813011a811796e70f970258f9 (diff)
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.
Diffstat (limited to 'gnu/services/base.scm')
-rw-r--r--gnu/services/base.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 0b4bd7ed0d..d9d73b4597 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,
-@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."
+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 #$@name-services))
+ (list
+ #$@(nscd-configuration-name-services
+ config)))
":")))))
(stop #~(make-kill-destructor))