emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59132: closed ([PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR


From: GNU bug Tracking System
Subject: bug#59132: closed ([PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login.)
Date: Mon, 26 Dec 2022 08:37:02 +0000

Your message dated Mon, 26 Dec 2022 09:36:10 +0100
with message-id <87v8lypnnp.fsf@gnu.org>
and subject line Re: bug#59132: [PATCH] system: images: wsl2: Create 
$XDG_RUNTIME_DIR on first login.
has caused the debbugs.gnu.org bug report #59132,
regarding [PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
59132: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59132
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login. Date: Wed, 9 Nov 2022 04:05:53 +0800
* gnu/system/images/wsl2.scm (wsl-boot-program): Create $XDG_RUNTIME_DIR on
first login.

copyright info
---
 gnu/system/images/wsl2.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/system/images/wsl2.scm b/gnu/system/images/wsl2.scm
index 80c2e775b4..e3e7503da3 100644
--- a/gnu/system/images/wsl2.scm
+++ b/gnu/system/images/wsl2.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2022 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 dan <i@dan.games>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -75,7 +76,11 @@ (define (wsl-boot-program user)
          (let* ((pw (getpw #$user))
                 (shell (passwd:shell pw))
                 (sudo #+(file-append sudo "/bin/sudo"))
-                (args (cdr (command-line))))
+                (args (cdr (command-line)))
+                (uid (passwd:uid pw))
+                (gid (passwd:gid pw))
+                (runtime-dir (string-append "/run/user/"
+                                            (number->string uid))))
            ;; Save the value of $PATH set by WSL.  Useful for finding
            ;; Windows binaries to run with WSL's binfmt interop.
            (setenv "WSLPATH" (getenv "PATH"))
@@ -88,6 +93,11 @@ (define (wsl-boot-program user)
                   MS_REMOUNT
                   #:update-mtab? #f)
 
+           ;; create XDG_RUNTIME_DIR for the login user
+           (unless (file-exists? runtime-dir)
+             (mkdir runtime-dir)
+             (chown runtime-dir uid gid))
+
            ;; Start login shell as user.
            (apply execl sudo "sudo"
                   "--preserve-env=WSLPATH"

base-commit: 96ae718c516a289124a0b91ceeef78b20d187825
-- 
2.38.0




--- End Message ---
--- Begin Message --- Subject: Re: bug#59132: [PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login. Date: Mon, 26 Dec 2022 09:36:10 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Hello,

> * gnu/system/images/wsl2.scm (wsl-boot-program): Create $XDG_RUNTIME_DIR on
> first login.

I did set the XDG_RUNTIME_DIR variable as well, and applied as
c50cd1bbece27097456242f246f89c053e7cc1a2.

Thanks,

Mathieu


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]