me
/
guix
Archived
1
0
Fork 0

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.
master
Ludovic Courtès 2014-07-07 23:58:02 +02:00
parent b3342b545a
commit 1c6b445b40
5 changed files with 33 additions and 41 deletions

View File

@ -88,8 +88,8 @@ sockets."
(requirement '(dbus-system networking)) (requirement '(dbus-system networking))
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
(string-append #$avahi "/sbin/avahi-daemon") (list (string-append #$avahi "/sbin/avahi-daemon")
"--syslog" "-f" #$config)) "--syslog" "-f" #$config)))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(activate #~(begin (activate #~(begin
(use-modules (guix build utils)) (use-modules (guix build utils))

View File

@ -236,7 +236,7 @@ the \"message of the day\"."
(requirement '(user-processes host-name)) (requirement '(user-processes host-name))
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
(string-append #$mingetty "/sbin/mingetty") (list (string-append #$mingetty "/sbin/mingetty")
"--noclear" #$tty "--noclear" #$tty
#$@(if auto-login #$@(if auto-login
#~("--autologin" #$auto-login) #~("--autologin" #$auto-login)
@ -246,7 +246,7 @@ the \"message of the day\"."
#~()) #~())
#$@(if login-pause? #$@(if login-pause?
#~("--loginpause") #~("--loginpause")
#~()))) #~()))))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(pam-services (pam-services
@ -269,10 +269,9 @@ the \"message of the day\"."
(use-modules (guix build utils)) (use-modules (guix build utils))
(mkdir-p "/var/run/nscd"))) (mkdir-p "/var/run/nscd")))
(start (start #~(make-forkexec-constructor
#~(make-forkexec-constructor (string-append #$glibc "/sbin/nscd") (list (string-append #$glibc "/sbin/nscd")
"-f" "/dev/null" "-f" "/dev/null" "--foreground")))
"--foreground"))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(respawn? #f))))) (respawn? #f)))))
@ -310,10 +309,9 @@ the \"message of the day\"."
(provision '(syslogd)) (provision '(syslogd))
(requirement '(user-processes)) (requirement '(user-processes))
(start (start
#~(make-forkexec-constructor (string-append #$inetutils #~(make-forkexec-constructor
"/libexec/syslogd") (list (string-append #$inetutils "/libexec/syslogd")
"--no-detach" "--no-detach" "--rcfile" #$syslog.conf)))
"--rcfile" #$syslog.conf))
(stop #~(make-kill-destructor)))))) (stop #~(make-kill-destructor))))))
(define* (guix-build-accounts count #:key (define* (guix-build-accounts count #:key
@ -387,10 +385,9 @@ hydra.gnu.org are used by default."
(provision '(guix-daemon)) (provision '(guix-daemon))
(requirement '(user-processes)) (requirement '(user-processes))
(start (start
#~(make-forkexec-constructor (string-append #$guix #~(make-forkexec-constructor
"/bin/guix-daemon") (list (string-append #$guix "/bin/guix-daemon")
"--build-users-group" "--build-users-group" #$builder-group)))
#$builder-group))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(user-accounts accounts) (user-accounts accounts)
(user-groups (list (user-group (user-groups (list (user-group
@ -409,6 +406,9 @@ hydra.gnu.org are used by default."
(requirement '(root-file-system)) (requirement '(root-file-system))
(documentation "Populate the /dev directory.") (documentation "Populate the /dev directory.")
(start #~(lambda () (start #~(lambda ()
(define udevd
(string-append #$udev "/libexec/udev/udevd"))
;; Allow udev to find the modules. ;; Allow udev to find the modules.
(setenv "LINUX_MODULE_DIRECTORY" (setenv "LINUX_MODULE_DIRECTORY"
"/run/booted-system/kernel/lib/modules") "/run/booted-system/kernel/lib/modules")
@ -416,14 +416,7 @@ hydra.gnu.org are used by default."
(let ((pid (primitive-fork))) (let ((pid (primitive-fork)))
(case pid (case pid
((0) ((0)
;; In dmd 0.1, file descriptor 0 is closed, thus (exec-command (list udevd)))
;; is gets reused when open(2) is called, and it
;; turns out that EPOLL_CTL_ADD of 0 returns
;; EPERM for some reason. So make sure 0 is
;; open.
;; FIXME: Close the other descriptors.
(execl (string-append #$udev "/libexec/udev/udevd")
"udevd"))
(else (else
;; Wait for things to settle down. ;; Wait for things to settle down.
(system* (string-append #$udev "/bin/udevadm") (system* (string-append #$udev "/bin/udevadm")

View File

@ -81,9 +81,9 @@ and policy files. For example, to allow avahi-daemon to use the system bus,
(provision '(dbus-system)) (provision '(dbus-system))
(requirement '(user-processes)) (requirement '(user-processes))
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
(string-append #$dbus "/bin/dbus-daemon") (list (string-append #$dbus "/bin/dbus-daemon")
"--nofork" "--nofork"
(string-append "--config-file=" #$conf "/system.conf"))) (string-append "--config-file=" #$conf "/system.conf"))))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(user-groups (list (user-group (user-groups (list (user-group
(name "messagebus")))) (name "messagebus"))))

View File

@ -125,7 +125,7 @@ The other options should be self-descriptive."
(documentation "GNU lsh SSH server") (documentation "GNU lsh SSH server")
(provision '(ssh-daemon)) (provision '(ssh-daemon))
(requirement '(networking)) (requirement '(networking))
(start #~(make-forkexec-constructor #$@lsh-command)) (start #~(make-forkexec-constructor (list #$@lsh-command)))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(pam-services (pam-services
(list (unix-pam-service (list (unix-pam-service

View File

@ -163,11 +163,10 @@ reboot_cmd " dmd "/sbin/reboot
(provision '(xorg-server)) (provision '(xorg-server))
(requirement '(user-processes host-name)) (requirement '(user-processes host-name))
(start (start
;; XXX: Work around the inability to specify env. vars. directly.
#~(make-forkexec-constructor #~(make-forkexec-constructor
(string-append #$bash "/bin/sh") "-c" (list (string-append #$slim "/bin/slim") "-nodaemon")
(string-append "SLIM_CFGFILE=" #$slim.cfg #:environment-variables
" " #$slim "/bin/slim" " -nodaemon"))) (list (string-append "SLIM_CFGFILE=" #$slim.cfg))))
(stop #~(make-kill-destructor)) (stop #~(make-kill-destructor))
(respawn? #t) (respawn? #t)
(pam-services (pam-services