我在 WSL设置文件中添加了这些行
C:\Users\reynadan\.wslconfig:
[boot]
command=bash /home/reynadan/scripts/startup.sh
Run Code Online (Sandbox Code Playgroud)
/etc/wsl.conf:
[boot]
command=bash /home/reynadan/scripts/startup.sh
Run Code Online (Sandbox Code Playgroud)
/home/reynadan/scripts/startup.sh
[boot]
command=bash /home/reynadan/scripts/startup.sh
Run Code Online (Sandbox Code Playgroud)
我关闭并wsl --shutdown等待了超过 8 秒才再次运行它,但/home/reynadan/wslBootHistory.txt仍然是空的并且 docker 没有运行。
如何确保 WSL 在启动时运行我的脚本?