From 00500449b0d53bb9219608a3cbee8faf7a3edae1 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Thu, 20 Feb 2020 14:05:06 +0100 Subject: services: udev: Do not rely on shepherd inheriting environment variables. Fixes . * gnu/services/base.scm (udev-shepherd-service)[start] Move or copy environment variables to 'fork+exec-command' instead of 'setenv'. --- gnu/services/base.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'gnu/services/base.scm') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 0c154d1c4e..706b3ae7ec 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 John Soo ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -2037,11 +2038,6 @@ (define (wait-for-udevd) (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules") - ;; The first one is for udev, the second one for eudev. - (setenv "UDEV_CONFIG_FILE" #$udev.conf) - (setenv "EUDEV_RULES_DIRECTORY" - #$(file-append rules "/lib/udev/rules.d")) - (let* ((kernel-release (utsname:release (uname))) (linux-module-directory @@ -2058,7 +2054,18 @@ (define (wait-for-udevd) (make-static-device-nodes directory)) (umask old-umask)) - (let ((pid (fork+exec-command (list udevd)))) + (let ((pid (fork+exec-command (list udevd) + #:environment-variables + (cons* + ;; The first one is for udev, the second one for + ;; eudev. + (string-append "UDEV_CONFIG_FILE=" #$udev.conf) + (string-append "EUDEV_RULES_DIRECTORY=" + #$(file-append + rules "/lib/udev/rules.d")) + (string-append "LINUX_MODULE_DIRECTORY=" + (getenv "LINUX_MODULE_DIRECTORY")) + (default-environment-variables))))) ;; Wait until udevd is up and running. This appears to ;; be needed so that the events triggered below are ;; actually handled. -- cgit v1.2.3