delay providing shell prompt until some signal or condition is met
- 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.**
i'm using an encrypted home directory that i mount using https://gist.github.com/razamatan/dcdc7188b0bd643401adeeccbc8164c8. everything works nice using gentoo's openrc as wsl's `boot.command`.
now, when i want to set my starting user to someone who's homedir is under /home, things break as the proper /home isn't available while openrc's various init scripts that i use to "start up" finish. b/c the prompt is given so fast, all the dotfiles for login is tried to be read from the empty /home directory which is the state it's in prior to being properly mounted.
i then can `exit` and go back in, and it works fine.
this gets old really quick as this happens every time wsl shuts down.
**Describe the solution you'd like**
the ideal solution is to have wsl2 be aware of the state of completion in openrc to completing running all the init scripts for default. if you tell me that systemd integration just works here, then i would consider moving to that.
a weaker solution would be to provide some command whose return value determines if the shell can be loaded. in my case, my /home is an ext4 partition, so it has a `/home/lost+found` directory. i could just have a test for that directory's presence.
**Describe alternatives you've considered**
i thought about trying systemd given that it's better supported, but i don't really like it. i would strongly consider trying if wsl2 is fully aware of the systemd startup state and delays providing the shell until it's complete.
i also thought about only allowing root to be the wsl2 startup user and having root's bashrc change from root's login to my user (`su`) after evaluating the shell condition to ensure /home was properly mounted.
**Additional context**
n/a
Contributor guide
Research direction
No repository files or tests are identified in the issue. Start by tracing WSL2 startup, the configured starting user, and the handoff to the shell while comparing the described openrc and systemd startup states; done means the shell is delayed until the requested signal or condition is satisfied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, shell
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100