Subject: Re: [bug#59132] [PATCH] system: images: wsl2: Create $XDG_RUNTIME_DIR on first login.

From: dan <[email-masked]>
Date: Wed, 9 Nov 2022 21:48:50 +0800

Hi Tobias,

On 11/9/2022 8:26 PM, Tobias Geerinckx-Rice wrote:
> Thanks!  Why is this needed?
> 
> On 2022-11-08 21:05, dan wrote:
>> * gnu/system/images/wsl2.scm (wsl-boot-program): Create $XDG_RUNTIME_DIR
> ^^^^^^^^^^^^^^^^
> There's no reference to this in the actual patch.
In my understanding, user level shepherd services need XDG_RUNTIME_DIR 
to run, and shepherd create a socket under XDG_RUNTIME_DIR/shepherd/. 
I'm not sure how WSL handle user login, but what we usually do is just 
type `wsl' in powershell, and it automatically logged into the default 
account, without prompting for password input.  Thus, relying ot elogind 
or greetd doesn't really help, it's better for us to manually create the 
directory.

There is also a warning on login, and I think it's from shepherd:
> warning: XDG_RUNTIME_DIR doesn't exists, on-first-login script won't 
> execute anything.  You can check if xdg runtime directory exists, 
> XDG_RUNTIME_DIR variable is set to appropriate value and manually 
> execute the script by running '$HOME/.guix-home/on-first-login
Anyway... I wasn't fully sure about if it's the right thing to do, since 
I'm not familiar enough with both Linux and WSL. But at least this makes 
user level services usable.  If this is the right thing to do, I'll 
update the patch with explanation included in the commit message.

Would like to hear feedback from someone authoritative!

-- 
dan