Skip to content
Snippets Groups Projects
Unverified Commit 1f8ca28b authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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.
parent 7462a1de
No related branches found
No related tags found
No related merge requests found
......@@ -176,18 +176,9 @@ (define (dbus-activation config)
(unless (file-exists? "/etc/machine-id")
(format #t "creating /etc/machine-id...~%")
(let ((prog (string-append #$(dbus-configuration-dbus config)
"/bin/dbus-uuidgen")))
;; XXX: We can't use 'system' because the initrd's
;; 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)))))))
(invoke (string-append #$(dbus-configuration-dbus config)
"/bin/dbus-uuidgen")
"--ensure=/etc/machine-id"))))
(define dbus-shepherd-service
(match-lambda
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment