From 1f8ca28b9e517f73d1a640dbbd11eadbf35b885b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Nov 2019 22:30:49 +0100 Subject: 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. --- gnu/services/dbus.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'gnu') diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index a97ce17c0c..7b3c8100e2 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -176,18 +176,9 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in (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 -- cgit 1.4.1