GNU bug report logs -
#59132
[PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login.
Previous Next
Reported by: dan <i <at> dan.games>
Date: Tue, 8 Nov 2022 20:07:02 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 26 Dec 2022 09:36:10 +0100
with message-id <87v8lypnnp.fsf <at> 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 <at> gnu.org.)
--
59132: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59132
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
* 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 <at> ajgrf.com>
;;; Copyright © 2022 Mathieu Othacehe <othacehe <at> gnu.org>
+;;; Copyright © 2022 dan <i <at> 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
[Message part 3 (message/rfc822, inline)]
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
This bug report was last modified 2 years and 226 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.