Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get D-Bus connection: Operation not permitted - CentOS 7 #54

Closed
pineking opened this issue Jul 30, 2016 · 4 comments
Closed
Assignees

Comments

@pineking
Copy link
Contributor

pineking commented Jul 30, 2016

根据 moby/moby#7459

  1. 问题:在docker CentOS 7 执行systemctl 命令会报 Failed to get D-Bus connection: No connection to service manager,以 systemctl status systemd-journald 命令为例
liuqs@BlackTurtle:~>docker run -ti centos:7 /bin/bash
[root@7430895f5868 /]# systemctl status systemd-journald
Failed to get D-Bus connection: Operation not permitted

解决方案:采用 /usr/sbin/init 自动启动 dbus daemon

$ docker run --privileged -d -ti -e "container=docker"  -v /sys/fs/cgroup:/sys/fs/cgroup  centos:7  /usr/sbin/init
6dd3234f6c9d3475fd56c2996ab25269d646aca4bde219166b0d4f6c9570046e

$ docker exec -it 6dd323 /bin/bash

[root@6dd3234f6c9d /]# systemctl status systemd-journald
● systemd-journald.service - Journal Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-journald.service; static; vendor preset: disabled)
   Active: active (running) since Sat 2016-07-30 11:35:10 UTC; 2min 22s ago
     Docs: man:systemd-journald.service(8)
           man:journald.conf(5)
 Main PID: 21 (systemd-journal)
   Status: "Processing requests..."
   CGroup: /docker/6dd3234f6c9d3475fd56c2996ab25269d646aca4bde219166b0d4f6c9570046e/system.slice/systemd-journald.service
           └─21 /usr/lib/systemd/systemd-journald

参考:

  1. https://github.com/DatawiseIO/c7-systemd-dbus
@pineking pineking changed the title Failed to get D-Bus connection: No connection to service manager - CentOS 7 Failed to get D-Bus connection: Operation not permitted - CentOS 7 Jul 30, 2016
@pineking
Copy link
Contributor Author

@wangkuiyi docker 运行 CentOS 7 测试 DHCP/nginx 等服务应该不是我们必须的?实际部署bootstrapper 机应该不是跑在 docker 里?

@wangkuiyi
Copy link
Contributor

wangkuiyi commented Jul 31, 2016

@pineking 你说的是。实际部署不在docker里。我引入docker只是为了unit test。

@wangkuiyi
Copy link
Contributor

wangkuiyi commented Aug 2, 2016

用VM代替Docker做测试 ( #81 ),希望解决这个问题。

@wangkuiyi wangkuiyi reopened this Aug 2, 2016
@wangkuiyi
Copy link
Contributor

#81 已经merge了。close这个issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants