mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
services: dbus: Simplify 'dbus-uuidgen' invocation.
* gnu/services/dbus.scm (dbus-activation): Use the "--ensure" option of 'dbus-uuidgen' instead of forking and redirecting ports.
This commit is contained in:
parent
7462a1de22
commit
1f8ca28b9e
1 changed files with 3 additions and 12 deletions
|
@ -176,18 +176,9 @@ (define (dbus-activation config)
|
||||||
|
|
||||||
(unless (file-exists? "/etc/machine-id")
|
(unless (file-exists? "/etc/machine-id")
|
||||||
(format #t "creating /etc/machine-id...~%")
|
(format #t "creating /etc/machine-id...~%")
|
||||||
(let ((prog (string-append #$(dbus-configuration-dbus config)
|
(invoke (string-append #$(dbus-configuration-dbus config)
|
||||||
"/bin/dbus-uuidgen")))
|
"/bin/dbus-uuidgen")
|
||||||
;; XXX: We can't use 'system' because the initrd's
|
"--ensure=/etc/machine-id"))))
|
||||||
;; guile system(3) only works when 'sh' is in $PATH.
|
|
||||||
(let ((pid (primitive-fork)))
|
|
||||||
(if (zero? pid)
|
|
||||||
(call-with-output-file "/etc/machine-id"
|
|
||||||
(lambda (port)
|
|
||||||
(close-fdes 1)
|
|
||||||
(dup2 (port->fdes port) 1)
|
|
||||||
(execl prog)))
|
|
||||||
(waitpid pid)))))))
|
|
||||||
|
|
||||||
(define dbus-shepherd-service
|
(define dbus-shepherd-service
|
||||||
(match-lambda
|
(match-lambda
|
||||||
|
|
Loading…
Reference in a new issue