Automatically apply PAM configuration ulimits on boot
@OneBlue is already working on this.
Since Mar 11, 2025.
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
Is your feature request related to a problem? Please describe.
My feature request is to have PAM configurations be read and applied by default when doing a "normal" boot of calling the wsl command.
Right now, when you do a normal boot of WSL2, anything in /etc/security/limits.conf is ignored. (Unlike in a true flesh-and-bone Ubuntu system.) The workaround to this is calling su [yourUsername] after booting WSL and already being logged in as that user. This will then force WSL2 to look at and apply the /etc/security/limits.conf contents.
Describe the solution you'd like
My feature request is to have PAM configurations be read and applied by default when doing a "normal" boot of calling the wsl command. Simply call wsl, and it reads/applies anything found in files like /etc/security/limits.conf.
Describe alternatives you've considered
The only known (and very ridiculous) workaround at the point is to call su [yourUsername] after booting WSL and already being logged in as that user. This will then force WSL2 to look at and apply the /etc/security/limits.conf contents. My feature request is to save the headache of having to do this extra step and discovering it for the first time through lots of web searching.
Additional context
I wanted to install MongoDB on my WSL instance, which has some ulimit considerations that you should upgrade. Easy, right? However, upon trying to make these simple changes, I uncovered a huge rabbit hole. After hours of researching and trying solutions this workaround was the only thing that I could get to succeed, and it was shocking to me that applying /etc/security/limits.conf configs wasn't simply built-in to WSL2.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.