summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-07 23:58:02 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-08 00:12:31 +0200
commit1c6b445b40dd693e9c2741942156258a89ebdb8b (patch)
tree46fa35abb87311511416389e8eee74109dffef11 /gnu
parentb3342b545a0147e2b501a94179cea6257fbe5213 (diff)
services: Update to use the dmd 0.2 API.
* gnu/services/avahi.scm (avahi-service)[start]: Wrap command in a list. * gnu/services/dbus.scm (dbus-service)[start]: Likewise. * gnu/services/ssh.scm (lsh-service): Likewise. * gnu/services/base.scm (mingetty-service)[start]: Likewise. (nscd-service)[start]: Likewise. (syslog-service)[start]: Likewise. (guix-service)[start]: Likewise. (udev-service)[start]: Use 'exec-command' instead of 'execl'. * gnu/services/xorg.scm (slim-service)[start]: Likewise, and use #:environment-variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/avahi.scm4
-rw-r--r--gnu/services/base.scm55
-rw-r--r--gnu/services/dbus.scm6
-rw-r--r--gnu/services/ssh.scm2
-rw-r--r--gnu/services/xorg.scm7
5 files changed, 33 insertions, 41 deletions
diff --git a/gnu/services/avahi.scm b/gnu/services/avahi.scm
index 4ba1a513ab0..e8da6be5f54 100644
--- a/gnu/services/avahi.scm
+++ b/gnu/services/avahi.scm
@@ -88,8 +88,8 @@ sockets."
88 (requirement '(dbus-system networking)) 88 (requirement '(dbus-system networking))
89 89
90 (start #~(make-forkexec-constructor 90 (start #~(make-forkexec-constructor
91 (string-append #$avahi "/sbin/avahi-daemon") 91 (list (string-append #$avahi "/sbin/avahi-daemon")
92 "--syslog" "-f" #$config)) 92 "--syslog" "-f" #$config)))
93 (stop #~(make-kill-destructor)) 93 (stop #~(make-kill-destructor))
94 (activate #~(begin 94 (activate #~(begin
95 (use-modules (guix build utils)) 95 (use-modules (guix build utils))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index bab07aa4b73..030121625bd 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -236,17 +236,17 @@ the \"message of the day\"."
236 (requirement '(user-processes host-name)) 236 (requirement '(user-processes host-name))
237 237
238 (start #~(make-forkexec-constructor 238 (start #~(make-forkexec-constructor
239 (string-append #$mingetty "/sbin/mingetty") 239 (list (string-append #$mingetty "/sbin/mingetty")
240 "--noclear" #$tty 240 "--noclear" #$tty
241 #$@(if auto-login 241 #$@(if auto-login
242 #~("--autologin" #$auto-login) 242 #~("--autologin" #$auto-login)
243 #~()) 243 #~())
244 #$@(if login-program 244 #$@(if login-program
245 #~("--loginprog" #$login-program) 245 #~("--loginprog" #$login-program)
246 #~()) 246 #~())
247 #$@(if login-pause? 247 #$@(if login-pause?
248 #~("--loginpause") 248 #~("--loginpause")
249 #~()))) 249 #~()))))
250 (stop #~(make-kill-destructor)) 250 (stop #~(make-kill-destructor))
251 251
252 (pam-services 252 (pam-services
@@ -269,10 +269,9 @@ the \"message of the day\"."
269 (use-modules (guix build utils)) 269 (use-modules (guix build utils))
270 (mkdir-p "/var/run/nscd"))) 270 (mkdir-p "/var/run/nscd")))
271 271
272 (start 272 (start #~(make-forkexec-constructor
273 #~(make-forkexec-constructor (string-append #$glibc "/sbin/nscd") 273 (list (string-append #$glibc "/sbin/nscd")
274 "-f" "/dev/null" 274 "-f" "/dev/null" "--foreground")))
275 "--foreground"))
276 (stop #~(make-kill-destructor)) 275 (stop #~(make-kill-destructor))
277 276
278 (respawn? #f))))) 277 (respawn? #f)))))
@@ -310,10 +309,9 @@ the \"message of the day\"."
310 (provision '(syslogd)) 309 (provision '(syslogd))
311 (requirement '(user-processes)) 310 (requirement '(user-processes))
312 (start 311 (start
313 #~(make-forkexec-constructor (string-append #$inetutils 312 #~(make-forkexec-constructor
314 "/libexec/syslogd") 313 (list (string-append #$inetutils "/libexec/syslogd")
315 "--no-detach" 314 "--no-detach" "--rcfile" #$syslog.conf)))
316 "--rcfile" #$syslog.conf))
317 (stop #~(make-kill-destructor)))))) 315 (stop #~(make-kill-destructor))))))
318 316
319(define* (guix-build-accounts count #:key 317(define* (guix-build-accounts count #:key
@@ -387,10 +385,9 @@ hydra.gnu.org are used by default."
387 (provision '(guix-daemon)) 385 (provision '(guix-daemon))
388 (requirement '(user-processes)) 386 (requirement '(user-processes))
389 (start 387 (start
390 #~(make-forkexec-constructor (string-append #$guix 388 #~(make-forkexec-constructor
391 "/bin/guix-daemon") 389 (list (string-append #$guix "/bin/guix-daemon")
392 "--build-users-group" 390 "--build-users-group" #$builder-group)))
393 #$builder-group))
394 (stop #~(make-kill-destructor)) 391 (stop #~(make-kill-destructor))
395 (user-accounts accounts) 392 (user-accounts accounts)
396 (user-groups (list (user-group 393 (user-groups (list (user-group
@@ -409,6 +406,9 @@ hydra.gnu.org are used by default."
409 (requirement '(root-file-system)) 406 (requirement '(root-file-system))
410 (documentation "Populate the /dev directory.") 407 (documentation "Populate the /dev directory.")
411 (start #~(lambda () 408 (start #~(lambda ()
409 (define udevd
410 (string-append #$udev "/libexec/udev/udevd"))
411
412 ;; Allow udev to find the modules. 412 ;; Allow udev to find the modules.
413 (setenv "LINUX_MODULE_DIRECTORY" 413 (setenv "LINUX_MODULE_DIRECTORY"
414 "/run/booted-system/kernel/lib/modules") 414 "/run/booted-system/kernel/lib/modules")
@@ -416,14 +416,7 @@ hydra.gnu.org are used by default."
416 (let ((pid (primitive-fork))) 416 (let ((pid (primitive-fork)))
417 (case pid 417 (case pid
418 ((0) 418 ((0)
419 ;; In dmd 0.1, file descriptor 0 is closed, thus 419 (exec-command (list udevd)))
420 ;; is gets reused when open(2) is called, and it
421 ;; turns out that EPOLL_CTL_ADD of 0 returns
422 ;; EPERM for some reason. So make sure 0 is
423 ;; open.
424 ;; FIXME: Close the other descriptors.
425 (execl (string-append #$udev "/libexec/udev/udevd")
426 "udevd"))
427 (else 420 (else
428 ;; Wait for things to settle down. 421 ;; Wait for things to settle down.
429 (system* (string-append #$udev "/bin/udevadm") 422 (system* (string-append #$udev "/bin/udevadm")
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 2f67e26a1e5..6076317ee58 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -81,9 +81,9 @@ and policy files. For example, to allow avahi-daemon to use the system bus,
81 (provision '(dbus-system)) 81 (provision '(dbus-system))
82 (requirement '(user-processes)) 82 (requirement '(user-processes))
83 (start #~(make-forkexec-constructor 83 (start #~(make-forkexec-constructor
84 (string-append #$dbus "/bin/dbus-daemon") 84 (list (string-append #$dbus "/bin/dbus-daemon")
85 "--nofork" 85 "--nofork"
86 (string-append "--config-file=" #$conf "/system.conf"))) 86 (string-append "--config-file=" #$conf "/system.conf"))))
87 (stop #~(make-kill-destructor)) 87 (stop #~(make-kill-destructor))
88 (user-groups (list (user-group 88 (user-groups (list (user-group
89 (name "messagebus")))) 89 (name "messagebus"))))
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 6d40cb489ba..fc46c345def 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -125,7 +125,7 @@ The other options should be self-descriptive."
125 (documentation "GNU lsh SSH server") 125 (documentation "GNU lsh SSH server")
126 (provision '(ssh-daemon)) 126 (provision '(ssh-daemon))
127 (requirement '(networking)) 127 (requirement '(networking))
128 (start #~(make-forkexec-constructor #$@lsh-command)) 128 (start #~(make-forkexec-constructor (list #$@lsh-command)))
129 (stop #~(make-kill-destructor)) 129 (stop #~(make-kill-destructor))
130 (pam-services 130 (pam-services
131 (list (unix-pam-service 131 (list (unix-pam-service
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 7215297f699..5eae4a87d87 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -163,11 +163,10 @@ reboot_cmd " dmd "/sbin/reboot
163 (provision '(xorg-server)) 163 (provision '(xorg-server))
164 (requirement '(user-processes host-name)) 164 (requirement '(user-processes host-name))
165 (start 165 (start
166 ;; XXX: Work around the inability to specify env. vars. directly.
167 #~(make-forkexec-constructor 166 #~(make-forkexec-constructor
168 (string-append #$bash "/bin/sh") "-c" 167 (list (string-append #$slim "/bin/slim") "-nodaemon")
169 (string-append "SLIM_CFGFILE=" #$slim.cfg 168 #:environment-variables
170 " " #$slim "/bin/slim" " -nodaemon"))) 169 (list (string-append "SLIM_CFGFILE=" #$slim.cfg))))
171 (stop #~(make-kill-destructor)) 170 (stop #~(make-kill-destructor))
172 (respawn? #t) 171 (respawn? #t)
173 (pam-services 172 (pam-services