gnu: vm: Add nscd service.

* gnu/system/dmd.scm (nscd-service): New procedure.
* gnu/system/vm.scm (system-qemu-image): Use it.  Make /var/run/nscd.
This commit is contained in:
Ludovic Courtès 2013-09-26 00:07:42 +02:00
parent de8bcdaeb5
commit 349746dfcd
2 changed files with 24 additions and 2 deletions

View File

@ -21,6 +21,8 @@
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix derivations) #:use-module (guix derivations)
#:use-module (guix records) #:use-module (guix records)
#:use-module ((gnu packages base)
#:select (glibc-final))
#:use-module ((gnu packages system) #:use-module ((gnu packages system)
#:select (mingetty inetutils)) #:select (mingetty inetutils))
#:use-module ((gnu packages package-management) #:use-module ((gnu packages package-management)
@ -39,6 +41,7 @@
host-name-service host-name-service
syslog-service syslog-service
mingetty-service mingetty-service
nscd-service
guix-service guix-service
static-networking-service static-networking-service
@ -87,6 +90,24 @@
(start `(make-forkexec-constructor ,mingetty-bin "--noclear" ,tty)) (start `(make-forkexec-constructor ,mingetty-bin "--noclear" ,tty))
(inputs `(("mingetty" ,mingetty)))))) (inputs `(("mingetty" ,mingetty))))))
(define* (nscd-service store
#:key (glibc glibc-final))
"Return a service that runs libc's name service cache daemon (nscd)."
(let ((nscd (string-append (package-output store glibc) "/sbin/nscd")))
(service
(provision '(nscd))
(start `(make-forkexec-constructor ,nscd "-f" "/dev/null"))
;; XXX: Local copy of 'make-kill-destructor' because the one upstream
;; uses the broken 'opt-lambda' macro.
(stop `(lambda* (#:optional (signal SIGTERM))
(lambda (pid . args)
(kill pid signal)
#f)))
(respawn? #f)
(inputs `(("glibc" ,glibc))))))
(define (syslog-service store) (define (syslog-service store)
"Return a service that runs 'syslogd' with reasonable default settings." "Return a service that runs 'syslogd' with reasonable default settings."

View File

@ -456,6 +456,7 @@ Happy birthday, GNU! http://www.gnu.org/gnu30
(mingetty-service store "tty6") (mingetty-service store "tty6")
(syslog-service store) (syslog-service store)
(guix-service store #:guix guix-0.4) (guix-service store #:guix guix-0.4)
(nscd-service store)
;; QEMU networking settings. ;; QEMU networking settings.
(static-networking-service store "eth0" "10.0.2.10"))) (static-networking-service store "eth0" "10.0.2.10")))
@ -517,8 +518,8 @@ You can log in as 'root' with no password.
")) "))
(populate `((directory "/etc") (populate `((directory "/etc")
(directory "/var/log") (directory "/var/log") ; for dmd
(directory "/var/run") (directory "/var/run/nscd")
("/etc/shadow" -> ,shadow) ("/etc/shadow" -> ,shadow)
("/etc/passwd" -> ,passwd) ("/etc/passwd" -> ,passwd)
("/etc/login.defs" -> "/dev/null") ("/etc/login.defs" -> "/dev/null")