-------------------------------------------------------------------------------------------------

|  欢迎关注个人公众号  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解决的更多相关文章

  1. Failed to get D-Bus connection: Operation not permitted解决

    docker中安装centos无法使用systemctl命令管理进程,报以下错误: Failed to get D-Bus connection: Operation not permitted 原因 ...

  2. 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 ...

  3. Docker 运行容器 CentOS7 使用systemctl 启动报错 Failed to get D-Bus connection: Operation not permitted

    原系统:Centos 7 Docker 版本:1.12.6 操作:安装并运行 Tomcat 问题:在创建好容器之后,并且进入系统运行启动tomcat [root@cd11558d3a22 /]# sy ...

  4. Failed to get D-Bus connection: Operation not permitted

    通过centos7镜像创建了一个docker容器,并在容器中安装了一个apache服务,但是启动时发生如下报错 [root@1346963c2247 ~]# rpm -qa | grep httpdh ...

  5. rsync同步时出现rsync: failed to set times on “xxxx”: Operation not permitted

    今天在同步数据的时候提示rsync: failed to set times on “xxxx”: Operation not permitted,一般来说要不是服务器时间不对或者权限没有设置好,下面 ...

  6. class-dump 复制到/usr/bin目录不可写,Operation not permitted 解决办法

    许多升级了OSX 10.11的朋友在配置class-dump的时候,会发现书上推荐的class-dump存放目录/usr/bin不再可写,如下所示: Operation not permitted 把 ...

  7. 使用npm install报错-4048 operation not permitted解决

    刚刚使用npm install时一直报错-4048 operation not permitted,也尝试了多种方法,终于使问题得到解决,这里总结几种方法,先贴图: 一:权限问题 首先看到operat ...

  8. 使用npm install报错- operation not permitted解决

    原文:https://blog.csdn.net/weixin_41715295/article/details/79508104 这几天使用npm install时一直报错-4048 operati ...

  9. Centos D-Bus connection: Operation not permitted

    解决办法: 首先要先在后台启动一个 CentOS7 容器(注意不要少参数): docker run -d -e "container=docker" --privileged=tr ...

随机推荐

  1. undo表空间丢失、损坏

    1.模拟误删undo表空间 rm -rf undotbs01.dbf 2.解决步骤 SQL> shutdown immediateORA-01116: error in opening data ...

  2. JavaSE11-多态&抽象类&接口

    1.多态 1.1 多态的概述 什么是多态 同一个对象,在不同时刻表现出来的不同形态 多态的前提 要有继承或实现关系 要有方法的重写 要有父类引用指向子类对象 1.2 多态中的成员访问特点 成员访问特点 ...

  3. Greenplum 性能优化之路 --(二)存储格式

    一.存储格式介绍 Greenplum(以下简称 GP)有2种存储格式,Heap 表和 AO 表(AORO 表,AOCO 表). Heap 表:这种存储格式是从 PostgreSQL 继承而来的,目前是 ...

  4. 移动端 CSS3动画属性

    一.transform 转换属性 #1. translate位移 transform : translate(50px,100px); //把元素水平移动 50 像素,垂直移动 100 像素 tran ...

  5. Javascript JQuery select选择之Safari与Firefox

    发现在苹果IOS手机及Safari浏览其中,如下代码不工作. $("#users option[value='hello']").attr("selected" ...

  6. Web服务器-并发服务器-长连接(3.4.4)

    @ 目录 1.说明 2.代码 关于作者 1.说明 每次new_socket都被强制关闭,造成短连接 所提不要关闭套接字 但是不关闭的话,浏览器不知道发完没有啊 此时用到header的属性Content ...

  7. 注解 @CrossOrigin

    在Controller中看到@CrossOrigin ,这是什么?有什么用?为什么要用? what? @CrossOrigin是用来处理跨域请求的注解 先来说一下什么是跨域: (站在巨人的肩膀上) 跨 ...

  8. [C#] (原创)进度等待窗口(附:自定义控件的使用)

    一.前言 技术没有先进与落后,只有合适与不合适. 在程序当中,经常有耗时较长的操作,为了给用户更好的体验,就需要给用户一个及时的反馈,这种时候就需要用到进度等待窗口. 实现进度等待窗口的技术有很多,比 ...

  9. CentOS7 实战源码部署apache网站服务器

    简介:实战演练apache网站服务器的搭建 Apache简介: Apache软件基金会的一个开源免费的网页服务器,也是目前世界上使用最广泛的一种web server , apache最出名的是它跨平台 ...

  10. js:表单校验(获取元素、事件)

    1.表单校验步骤 (1)确定事件(submit事件),创建一个函数并和该事件绑定. (2)书写函数对输入的数据是否合法进行校验(需要设定ID并通过ID来获取用户输入的数据的值). (3)输入的信息合法 ...