docker centos 使用 systemctl Failed to get D-Bus connection: Operation not permitted
来源:互联网 发布:男生不喜欢女生 知乎 编辑:程序博客网 时间:2024/05/21 10:31
我们知道,Docker运行一个容器起来的时候,只是为你提供特定的文件系统层和进程隔离,它给你一个VM的感觉却并不是VM,所以你可能偶尔会想要像在物理机那样使用systemctl start|status|stop来管理服务进程,然后你通常会看到
Failed to get D-Bus connection: Operation not permitted
这个错误。
原因很简单:
你需要启动systemd进程
你需要特权
所以你如果想要一个可以使用Systemd的容器,你可以尝试这样启动容器:
1.解决办法一:给权限
cat /etc/redhat-release //CentOS Linux release 7.2.1511 (Core) docker run -tdi --privileged centos init
在容器中,你可以使用systemd管理服务进程了:
yum install -y vsftpdsystemctl start vsftpdsystemctl status vsftpd
2.解决办法二:init.d
除此之外你也可以通过其他启动软件的方式: init.d来达到 systemctl 的效果:
比如要启动 mysql 服务:/etc/init.d/mysql start
阅读全文
0 0
- docker centos 使用 systemctl Failed to get D-Bus connection: Operation not permitted
- Docker Container Centos7 systemctl 提示 Failed to get D-Bus connection: Operation not permitted
- 解决docker执行systemctl start 报错Failed to get D-Bus connection: Operation not permitted
- docker Failed to get D-Bus connection: Operation not permitted
- Docker容器使用问题:Failed to get D-Bus connection: Operation not permitted
- Failed to get D-Bus connection: Operation not permitted
- Failed to get D-Bus connection: Operation not permitted
- Failed to get D-Bus connection: Operation not permitted
- docker容器中启动service服务 Failed to get D-Bus connection: Operation not permitted
- Docker之 Failed to get D-Bus connection: Operation not permitted
- CentOS 7 镜像报错 Failed to get D-Bus connection: Operation not permitted
- docker中的centos7使用时报Failed to get D-BUS connection: Operation no permitted
- 解决 CentOS7 容器 Failed to get D-Bus connection: Operation not permitted
- docker Failed to get D-Bus connection 报错
- Docker: Failed to get D-Bus connection: No connection to service
- centos7 docker容器报 docker Failed to get D-Bus connection 错误
- centos7 docker容器报 docker Failed to get D-Bus connection 错误
- 配置centos7解决 docker Failed to get D-Bus connection 报错
- C++学习之Pair
- 局域网技术
- 在C++中调用Jieba进行中文分词
- tensorflow API:tf.Variable
- 点击编辑 弹出弹框(iframe)
- docker centos 使用 systemctl Failed to get D-Bus connection: Operation not permitted
- J2EE相关概念
- 土豪向往技术宅,迪拜欲成中东的区块链老大
- python 高度健壮性爬虫的异常和超时问题
- PHP关于时间的时间戳
- 利用某网站注册短信验证码漏洞,抓包改包实现短信轰炸骚扰
- Android 定时任务刷新的多种实现方式
- iOS真机调试出错解决方法
- 在redis使用过程遇到的一些问题的总结