【Docker】Failed to get D-Bus connection: Operation not permitted解决
-------------------------------------------------------------------------------------------------
| 欢迎关注个人公众号 zclinux_note 第一时间获取关于linux使用的技巧。探索Linux的奥秘 |
-------------------------------------------------------------------------------------------------
在centos镜像中执行systemctl restart httpd 失败,提示
Failed to get D-Bus connection: Operation not permitted
原因在于
1.没有启动systemd进程
2.没有使用特权
执行下面的命令,即可解决上述1,2的问题
docker run -itd --privileged centos init
执行完成后,再执行失败的命令,即可成功
或者去容器里验证下是否启动成功,是否可以使用systemctl命令
docker exec -it 487acf4373bc /bin/bash
systemctl restart httpd
ps -ef | grep http
root 3542 1 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3543 3542 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3544 3542 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3545 3542 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3546 3542 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 3547 3542 0 08:44 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root 3549 3449 0 08:44 pts/1 00:00:00 grep --color=auto http
证明成功了
【Docker】Failed to get D-Bus connection: Operation not permitted解决的更多相关文章
- Failed to get D-Bus connection: Operation not permitted解决
docker中安装centos无法使用systemctl命令管理进程,报以下错误: Failed to get D-Bus connection: Operation not permitted 原因 ...
- docker—tomcat 报错:Failed to get D-Bus connection: Operation not permitted
docker search centos 查系统镜像 docker pull docker.io/centos 进入容器 [root@git opt]# docker images REPOSIT ...
- Docker 运行容器 CentOS7 使用systemctl 启动报错 Failed to get D-Bus connection: Operation not permitted
原系统:Centos 7 Docker 版本:1.12.6 操作:安装并运行 Tomcat 问题:在创建好容器之后,并且进入系统运行启动tomcat [root@cd11558d3a22 /]# sy ...
- Failed to get D-Bus connection: Operation not permitted
通过centos7镜像创建了一个docker容器,并在容器中安装了一个apache服务,但是启动时发生如下报错 [root@1346963c2247 ~]# rpm -qa | grep httpdh ...
- rsync同步时出现rsync: failed to set times on “xxxx”: Operation not permitted
今天在同步数据的时候提示rsync: failed to set times on “xxxx”: Operation not permitted,一般来说要不是服务器时间不对或者权限没有设置好,下面 ...
- class-dump 复制到/usr/bin目录不可写,Operation not permitted 解决办法
许多升级了OSX 10.11的朋友在配置class-dump的时候,会发现书上推荐的class-dump存放目录/usr/bin不再可写,如下所示: Operation not permitted 把 ...
- 使用npm install报错-4048 operation not permitted解决
刚刚使用npm install时一直报错-4048 operation not permitted,也尝试了多种方法,终于使问题得到解决,这里总结几种方法,先贴图: 一:权限问题 首先看到operat ...
- 使用npm install报错- operation not permitted解决
原文:https://blog.csdn.net/weixin_41715295/article/details/79508104 这几天使用npm install时一直报错-4048 operati ...
- Centos D-Bus connection: Operation not permitted
解决办法: 首先要先在后台启动一个 CentOS7 容器(注意不要少参数): docker run -d -e "container=docker" --privileged=tr ...
随机推荐
- Spring中毒太深,离开Spring我居然连最基本的接口都不会写了
前言 随着 Spring 的崛起以及其功能的完善,现在可能绝大部分项目的开发都是使用 Spring(全家桶) 来进行开发,Spring也确实和其名字一样,是开发者的春天,Spring 解放了程序员的双 ...
- Security篇:RememberMe
RememberMe功能 rememberMeServices接口 有AbstractRememberMeServices抽象类 PersistentTokenBasedRememberMeServi ...
- Feign String 参数 传递null 以及 空字符串问题
笔记链接:https://app.yinxiang.com/fx/c82f6d74-3432-4703-83c8-5175f5986f97 备注 因为笔记在印象笔记上进行编辑,而且为Markdown格 ...
- Flink如何做维表关联?
使用 RichAsyncFunction 加 CacheBuilder CacheBuilder.newBuilder() //最多存储10000条 .maximumSize(10000) //过期时 ...
- 使用CDN后如何配置Apache使其记录访客真实IP
今天想看看哪些地区的人访问过我的网站,于是打开Apache网站响应日志,把访客IP复制到百度,发现搜到的全部都是我是用的CDN的节点IP,真实的访客IP并没有被记录. 如图所示,上面的103.45.7 ...
- 基于frp的内网穿透实例1-通过SSH访问内网机器
原文地址:https://wuter.cn/1804.html/ 老母鸡终于到了,作为一个能运行linux系统的四核1G硬件,它还是比较小巧的. FRP 全名:Fast Reverse Proxy.F ...
- Quatz JobListener和TriggerListener
myJob:triggerFired... vetoJobExecution class coder.rdf.mybatis.study.JobTest:jobToBeExecuted... test ...
- 后台查询出来的list结果 在后台查询字典表切换 某些字段的内容
list=listEFormat(list, "Class_type", "611");//list查询数据库得到的结果Class_type /** * @Ti ...
- 扫盲:Kotlin 的泛型
引子 相信总是有很多同学,总是在抱怨泛型无论怎么学习,都只是停留在一个简单使用的水平,所以一直为此而备受苦恼. Kotlin 作为一门能和 Java 相互调用的语言,自然也支持泛型,不过 Kotlin ...
- 你说一下Redis为什么快吧,怎么实现高可用,还有持久化怎么做的?
前言 作为Java程序员,在面试过程中,缓存相关的问题是躲不掉的,肯定会问,例如缓存一致性问题,缓存雪崩.击穿.穿透等.说到缓存,那肯定少不了Redis,我在面试的时候也是被问了很多关于Redis相关 ...