vim Makefile 查看安装脚本,默认安装目录是 /usr/libexec/genie,没有配置软链接,因此在最后一步使用 ln 命令增加了软链接 。
现在就可以借助 genie 运行 systemctl 命令了 。
4、genie 的使用genie 有三个指令:
genie -i 启动 systemd 进程genie -s 启动 systemd 进程,并进入该环境终端genie -c <command> 启动 systemd 进程,并执行相应的指令示例:安装 openssh 并运行
dnf install openssh-servergenie -c systemctl start sshd5、使用 pstree 命令查看进程树dnf -y install psmisc #安装pstreepstree -ap #查看进程树可以看到由守护进程 unshare 下的 systemd 空间,将会运行所有的 systemd 进程 。

文章插图
此时,使用 ssh 客户端,可以登录这个 CentOS 系统 。
另外使用命令: genie systemctl enable sshd,不能实现开机启动 。
八、感受利用第三方工具 genie ,完成了在 WSL 中运行 systemctl 的研究与实践,实现了在 WSL Linux 系统中运行 systemctl 命令的效果,但实际使用中总觉得别扭,我个人最终选择,还是老老实实编译安装 nginx mysql 等服务软件吧!
参考:https://www.oyohyee.com/post/note_wsl2_systemd
http://blog.davy.tw/tags/linux/
https://github.com/arkane-systems/genie
https://github.com/DamionGans/ubuntu-wsl2-systemd-script
【WSL2 中使用 systemctl 命令】
推荐阅读
- 白茶饼中间黑色,安吉白茶绿茶中的白茶
- 史书上不会公开的历史真相 中国古代历史未解之谜
- 绿茶的种种分类方式,中国茶是什么分类的
- 牙齿中间有黑色的东西洗不掉怎么办 牙齿里面有黑色的东西怎么洗干净
- 蒸红枣馒头的做法大全
- 有颜色的馒头怎么做
- 奶油馒头的奶油是什么
- 交管12123使用时间段是多久?
- 我国主要的五大宗教是什么?
- 高考英语作文中书信的格式
