一、问题场景
本地Windows10启动WSL的centos7,然后在安装docker-ce之后,启动报错,错误提示如下:
Redirecting to /bin/systemctl start docker.service
Failed to get D-Bus connection: Operation not permitted
本篇博客主要讲诉解决方案。
二、解决方案
主要是更换systemctl文件。
1、备份systemctl文件
mv /usr/bin/systemctl /usr/bin/systemctl.old
2、获取新文件
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py > /usr/bin/systemctl
3、设置可执行
chmod +x /usr/bin/systemctl
三、结果
顺利解决,截图如下:
[root@xxx xxx]# service docker start
Redirecting to /bin/systemctl start docker.service
/usr/sbin/service: line 87: /bin/systemctl: Success