标签:point sbin lan not step path 启动 cgroups 哪些
在centos7的容器里面出现了一个BUG,就是serveice启动服务的时候出现报错,不能用service启动服务。
[root@e13c3d3802d0 /]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Failed to get D-Bus connection: Operation not permitted
首先恭喜你使用centos7镜像,然后就是不幸告诉你这个问题是个BUG 将在centos7.2解决。
Currently, systemd in CentOS 7 has been removed and replaced with a fakesystemd package for dependency resolution. This is due to systemd requiring the CAP_SYS_ADMIN capability, as well as being able to read the host‘s cgroups. If you wish to replace the fakesystemd package and use systemd normally, please follow the steps below.
我查了好多地方都说是个BUG不能解决
有的说创建的时候加上 --privileged选项
我试了这些然而并没有任何的卵用
最后实在是没办法就 rpm -ql 软件包 查看安装的时候有哪些命令在PATH下,用这些命令去启动,这个是一种解决的方法
例如apache的启动就是用命令 httpd
这几天研究了个解决的办法比较靠谱,亲身实测好使:
systemctl start http.service
Failed to get D-Bus connection: No connection to service manager.
这个的原因是因为dbus-daemon没能启动。其实systemctl并不是不可以使用。将你的CMD或者entrypoint设置为/usr/sbin/init即可。会自动将dbus等服务启动起来。
然后就可以使用systemctl了。命令如下:
docker run --privileged -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup centos /usr/sbin/init
轻松无压力解决
配置centos7解决 docker Failed to get D-Bus connection 报错
标签:point sbin lan not step path 启动 cgroups 哪些
原文地址:https://www.cnblogs.com/as007012/p/10042387.html