From 349746dfcd9a07e3b5908d459d0800fd5d44c3b9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Sep 2013 00:07:42 +0200 Subject: 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. --- gnu/system/dmd.scm | 21 +++++++++++++++++++++ gnu/system/vm.scm | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gnu/system/dmd.scm b/gnu/system/dmd.scm index 7fc4650c25..b248d9f0c5 100644 --- a/gnu/system/dmd.scm +++ b/gnu/system/dmd.scm @@ -21,6 +21,8 @@ (define-module (gnu system dmd) #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix records) + #:use-module ((gnu packages base) + #:select (glibc-final)) #:use-module ((gnu packages system) #:select (mingetty inetutils)) #:use-module ((gnu packages package-management) @@ -39,6 +41,7 @@ (define-module (gnu system dmd) host-name-service syslog-service mingetty-service + nscd-service guix-service static-networking-service @@ -87,6 +90,24 @@ (define (mingetty-service store tty) (start `(make-forkexec-constructor ,mingetty-bin "--noclear" ,tty)) (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) "Return a service that runs 'syslogd' with reasonable default settings." diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index b873386606..0ed805510a 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -456,6 +456,7 @@ (define %dmd-services (mingetty-service store "tty6") (syslog-service store) (guix-service store #:guix guix-0.4) + (nscd-service store) ;; QEMU networking settings. (static-networking-service store "eth0" "10.0.2.10"))) @@ -517,8 +518,8 @@ (define resolv.conf ")) (populate `((directory "/etc") - (directory "/var/log") - (directory "/var/run") + (directory "/var/log") ; for dmd + (directory "/var/run/nscd") ("/etc/shadow" -> ,shadow) ("/etc/passwd" -> ,passwd) ("/etc/login.defs" -> "/dev/null") -- cgit v1.2.3