在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. 登录mysql报错Failed to connect to backoff 或 Failed to get D-Bus connection: Operation not permitted解决方法

    报错: Failed to get D-Bus connection: Operation not permitted 或 mysql -u root -p 登录mysql时报错 2020-09-16 ...

  2. 解决 CentOS7 容器 Failed to get D-Bus connection: Operation not permitted

    事由:通过 systemctl start crond 启动任务时报错,具体如下 Failed to get D-Bus connection: Operation not permitted 解决方 ...

  3. linux docker 报错 Failed to get D-Bus connection: Operation not permitted

    使用centos7镜像创建容器后,在里面使用systemctl启动服务报错.针对这个报错,我们接下来就分析下! # docker run -itd --name centos7 centos:7 # ...

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

    wsl 运行的 centos 7,使用 service 命令提示 Failed to get D-Bus connection: Operation not permitted 错误,无法运行. 目前 ...

  5. Dbus启动问题 Failed to get D-Bus connection: Operation not permitted

    最近在服务器看到,abrt-action-gen服务一直在跑,且占用较多内存,经查询后发现是abrtd服务出现问题,用systemctl erestart abrtd. systemctl erest ...

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

    今天在同步数据的时候提示rsync: failed to set times on "xxxx": Operation not permitted,一般来说要不是服务器时间不对或者 ...

  7. 启动WIFI时:equest firmware failed with error 0xfffffffe ifconfig: SIOCSIFFLAGS: Operation not permitted

    一. 问题描述. 嵌入式开发中,启动rtl8188eu无线网卡时弹出如下信息: root@ms:~# ifconfig wlan0 up [ 21.829050] Request firmware f ...

  8. docker strace ptrace 报错 Operation not permitted 解决方法

    docker中gdb在进行进程debug时,会报错: (gdb) attach 30721 Attaching to process 30721 ptrace: Operation not permi ...

  9. 【node】windows使用 npm i -g报错operation not permitted解决方法

    前言 公司电脑被装了安全控制软件后导致npm -g 安装很多东西提示operation not permitted,后来研究了下怎么解决该问题. 解决方式 首先打开不允许操作的路径,比如我这个报错: ...

  10. Mac提示operation not permitted解决方式

    Mac上一些操作需要系统权限,输入正确密码时,一般情况下设置命令就可以解决:sudo chmod -R 777 要修改文件上层目录的路径. 但是部分情况下除外,比如sudo 移动到文件到 /usr/b ...

最新文章

  1. Mirosoft Office自动化问题
  2. 深入分析 Java I/O 的工作机制
  3. 福师《计算机应用基础》期末考试,21年2月福师《计算机应用基础》期末考试A卷答案...
  4. 二十五、长短时记忆神经网络
  5. Codeforces Round #626 (Div. 2) D. Present 按位贡献 + 快排新姿势
  6. 备忘(持续更新。。。)
  7. labview与单片机正弦信号_LabVIEW小白入门——低通滤波器
  8. 基于文本和语音的双模态情感分析
  9. 设计模式——工厂模式(包含:简单工厂模式、工厂方法模式、抽象工厂模式)
  10. 生成田字格模板(word)
  11. 转载:为某燃气公司做的一部卡通角色广告动画
  12. DFS.01-寻路问题
  13. python学习之编写学员管理系统
  14. pku 1392 Ouroboros Snake
  15. Google着手与 Open AI 合作预防人工智能暴走
  16. FortiGate FGCP HA 配置文档
  17. 计算机信息系统集成资质涉密信息系统集成资质
  18. 睡眠多少分钟一个循环_你知道睡眠周期吗?
  19. 机械革命Code01开启Hyper-V/安装Docker无限蓝屏解决方法
  20. python输入矩形的长和宽、求周长_输入矩形的长和宽,求出该矩形的周长和面积...

热门文章

  1. 争对让望对思野葛对山栀注解_《笠翁对韵》注音注释(四支)
  2. matlab 求拟合直线的斜率_如何用matlab求出图中各条直线的斜率
  3. 听吐的微信提示音终于能改了
  4. nexus9刷机全记录
  5. 【uniapp微信小程序组件】大转盘抽奖组件
  6. HDUOJ---汉洛塔IX
  7. 生成领料单(编号:20110704A1153)
  8. qq红包代码加群链接
  9. 计算机网络.第四节课.笔记.CRC循环冗余检验、透明传输、SOH、EOT、PPP点对点协议、零比特填充、字节填充
  10. Vmware1个服务器2个桌面,VMware设置虚拟机,并配置远程连接桌面