[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/12: PRELIM: services: nscd-service: Fit everything into <nscd-configu
From: |
Ludovic Courtès |
Subject: |
07/12: PRELIM: services: nscd-service: Fit everything into <nscd-configuration>. |
Date: |
Sat, 19 Sep 2015 16:12:28 +0000 |
civodul pushed a commit to branch wip-service-refactor
in repository guix.
commit 1fd61927d68736268c8383f99e5003b2b6e540db
Author: Ludovic Courtès <address@hidden>
Date: Sun Sep 13 12:43:28 2015 +0200
PRELIM: services: nscd-service: Fit everything into <nscd-configuration>.
PRELIM: doc missing
* 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.
---
gnu/services/base.scm | 22 +++++++++++++---------
gnu/services/desktop.scm | 4 ++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index ac7a37f..7b68111 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -409,7 +409,11 @@ the tty to run, among 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?
@@ -499,13 +503,10 @@ the tty to run, among 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).")
@@ -518,7 +519,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
@@ -526,7 +528,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.
;;
- branch wip-service-refactor created (now dd71a9e), Ludovic Courtès, 2015/09/19
- 02/12: gexp: Add 'program-file'., Ludovic Courtès, 2015/09/19
- 03/12: gexp: Add 'mixed-text-file'., Ludovic Courtès, 2015/09/19
- 01/12: gexp: Add 'computed-file'., Ludovic Courtès, 2015/09/19
- 04/12: services: 'mingetty-service' no longer takes monadic values., Ludovic Courtès, 2015/09/19
- 07/12: PRELIM: services: nscd-service: Fit everything into <nscd-configuration>.,
Ludovic Courtès <=
- 06/12: PRELIM: services: mingetty-service: Use <mingetty-configuration> objects., Ludovic Courtès, 2015/09/19
- 08/12: gexp: Add 'scheme-file'., Ludovic Courtès, 2015/09/19
- 09/12: system: pam: Use 'computed-file' instead of 'gexp->derivation'., Ludovic Courtès, 2015/09/19
- 10/12: guix system: Add '--derivation'., Ludovic Courtès, 2015/09/19
- 11/12: system: Account skeleton API is non-monadic., Ludovic Courtès, 2015/09/19
- 12/12: PRELIM: services: Introduce extensible abstract services., Ludovic Courtès, 2015/09/19
- 05/12: system: Make service procedures non-monadic., Ludovic Courtès, 2015/09/19