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.master
parent
66e4f01c60
commit
b893f1aec3
|
@ -5795,11 +5795,9 @@ The Mingetty package to use.
|
||||||
@cindex nscd
|
@cindex nscd
|
||||||
@deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @
|
@deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @
|
||||||
[#:name-services '()]
|
[#:name-services '()]
|
||||||
Return a service that runs libc's name service cache daemon (nscd) with
|
Return a service that runs libc's name service cache daemon (nscd) with the
|
||||||
the given @var{config}---an @code{<nscd-configuration>} object.
|
given @var{config}---an @code{<nscd-configuration>} object. @xref{Name
|
||||||
Optionally, @code{#:name-services} is a list of packages that provide
|
Service Switch}, for an example.
|
||||||
name service switch (NSS) modules needed by nscd. @xref{Name Service
|
|
||||||
Switch}, for an example.
|
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@defvr {Scheme Variable} %nscd-default-configuration
|
@defvr {Scheme Variable} %nscd-default-configuration
|
||||||
|
@ -5814,6 +5812,14 @@ configuration.
|
||||||
|
|
||||||
@table @asis
|
@table @asis
|
||||||
|
|
||||||
|
@item @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})}.
|
||||||
|
|
||||||
|
@item @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"})
|
@item @code{log-file} (default: @code{"/var/log/nscd.log"})
|
||||||
Name of nscd's log file. This is where debugging output goes when
|
Name of nscd's log file. This is where debugging output goes when
|
||||||
@code{debug-level} is strictly positive.
|
@code{debug-level} is strictly positive.
|
||||||
|
@ -6542,8 +6548,8 @@ configuration file:
|
||||||
;; about nss-mdns.
|
;; about nss-mdns.
|
||||||
(map (lambda (service)
|
(map (lambda (service)
|
||||||
(if (member 'nscd (service-provision service))
|
(if (member 'nscd (service-provision service))
|
||||||
(nscd-service (nscd-configuration)
|
(nscd-service (nscd-configuration
|
||||||
#:name-services (list nss-mdns))
|
(name-services (list nss-mdns))))
|
||||||
service))
|
service))
|
||||||
%base-services))
|
%base-services))
|
||||||
@end example
|
@end example
|
||||||
|
|
|
@ -412,7 +412,11 @@ other things."
|
||||||
(default 0))
|
(default 0))
|
||||||
;; TODO: See nscd.conf in glibc for other options to add.
|
;; TODO: See nscd.conf in glibc for other options to add.
|
||||||
(caches nscd-configuration-caches ;list of <nscd-cache>
|
(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
|
(define-record-type* <nscd-cache> nscd-cache make-nscd-cache
|
||||||
nscd-cache?
|
nscd-cache?
|
||||||
|
@ -502,13 +506,10 @@ other things."
|
||||||
(string-concatenate
|
(string-concatenate
|
||||||
(map cache->config caches)))))))
|
(map cache->config caches)))))))
|
||||||
|
|
||||||
(define* (nscd-service #:optional (config %nscd-default-configuration)
|
(define* (nscd-service #:optional (config %nscd-default-configuration))
|
||||||
#:key (glibc (canonical-package glibc))
|
|
||||||
(name-services '()))
|
|
||||||
"Return a service that runs libc's name service cache daemon (nscd) with the
|
"Return a service that runs libc's name service cache daemon (nscd) with the
|
||||||
given @var{config}---an @code{<nscd-configuration>} object. Optionally,
|
given @var{config}---an @code{<nscd-configuration>} object. @xref{Name
|
||||||
@code{#:name-services} is a list of packages that provide name service switch
|
Service Switch}, for an example."
|
||||||
(NSS) modules needed by nscd. @xref{Name Service Switch}, for an example."
|
|
||||||
(let ((nscd.conf (nscd.conf-file config)))
|
(let ((nscd.conf (nscd.conf-file config)))
|
||||||
(service
|
(service
|
||||||
(documentation "Run libc's name service cache daemon (nscd).")
|
(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
|
(mkdir-p "/var/db/nscd"))) ;for the persistent cache
|
||||||
|
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(list (string-append #$glibc "/sbin/nscd")
|
(list (string-append #$(nscd-configuration-glibc config)
|
||||||
|
"/sbin/nscd")
|
||||||
"-f" #$nscd.conf "--foreground")
|
"-f" #$nscd.conf "--foreground")
|
||||||
|
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
|
@ -529,7 +531,9 @@ given @var{config}---an @code{<nscd-configuration>} object. Optionally,
|
||||||
(string-join
|
(string-join
|
||||||
(map (lambda (dir)
|
(map (lambda (dir)
|
||||||
(string-append dir "/lib"))
|
(string-append dir "/lib"))
|
||||||
(list #$@name-services))
|
(list
|
||||||
|
#$@(nscd-configuration-name-services
|
||||||
|
config)))
|
||||||
":")))))
|
":")))))
|
||||||
(stop #~(make-kill-destructor))
|
(stop #~(make-kill-destructor))
|
||||||
|
|
||||||
|
|
|
@ -594,8 +594,8 @@ when they log out."
|
||||||
(cond
|
(cond
|
||||||
;; Provide an nscd ready to use nss-mdns.
|
;; Provide an nscd ready to use nss-mdns.
|
||||||
((memq 'nscd (service-provision service))
|
((memq 'nscd (service-provision service))
|
||||||
(nscd-service (nscd-configuration)
|
(nscd-service (nscd-configuration
|
||||||
#:name-services (list nss-mdns)))
|
(name-services (list nss-mdns)))))
|
||||||
|
|
||||||
;; Add more rules to udev-service.
|
;; Add more rules to udev-service.
|
||||||
;;
|
;;
|
||||||
|
|
Reference in New Issue