-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL spawns an extra shell process #11611
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging |
/question |
Diagnostic information
|
By design. You won't get rid of it. You're using systemd with wsl I assume? Edit: double checked, use wsl without systemd if you don't want that there. It creates a systemd user session. |
Thanks for the information, at least I know it's expected :) Is it documented anywhere? |
It wouldn't be realistic for us to do that. So many pitfalls in doing that. We don't want people to rely on details like this. Details that are side effects of the implementation. |
I was thinking primarily along the lines of "there's this extra shell as a result of WSL inner workings". At least we have this bug now :) Thanks! |
I just spent the better part of an afternoon trying to figure out wtf this extra login was (concerned about security) and eventually came across this... I second @yacoob on the documentation. if this is normal behaviour for systemd but isn't documented as such then it's suspicious... |
Windows Version
Microsoft Windows [Version 10.0.22631.3593]
WSL Version
WSL version: 2.1.5.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.146.1-microsoft-standard-WSL2
Distro Version
Debian 12 bookworm
Other Software
No response
Repro Steps
wsl.exe --install Debian
, createthatuser
accountwsl -d Debian -u thatuser
ps afux
Expected Behavior
There should be a single shell process that belongs to
thatuser
running on the system.Actual Behavior
There are two shell processes running - one of them spawned by
/init
, handling the user interaction, the other spawned by/bin/login -f
doing... something else.Both of those shells are marked as a login shell. In another Debian 12 box I have access to, the process tree looks as expected: single login shell spawned by the login process:
Just for completness, I've tested how
login -f
works on a physical Debian12 box, and it did not spawn a second shell. From my cursory interrogation of/proc
for both of those shells, they're both running in the same cgroup but different sessions. I have no idea howsystemd
perceives that due to #8879 .Last but not least: mintty/wsltty#197 is very similar, except in my case I'm not using
mintty
at all :)I'd appreciate some explanation around that second shell - why is it needed, what does it do, and - if it's a WSL thing - how can I get rid of it?
Thanks! :)
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: