如何在 Windows WSL 上运行 init.d 脚本?

Olu*_*aya 7 windows-subsystem-for-linux

适用于 Linux 的 Windows 子系统,截至 2018 年 5 月仍然不支持init.dsystemd服务管理,我遇到了服务和几个在线选项的问题,在所有情况下都无法最佳工作

Olu*_*aya 5

以下 bash 脚本对我有用.. 注意continue操作符需要跳过失败的脚本,并且start大多数服务脚本都需要参数..我相信

for f in /etc/init.d/*; do sh "$f" start || continue; done ;
Run Code Online (Sandbox Code Playgroud)