1

getting error"Failed to get D-Bus connection: Operation not permitted" while using systemctl command for restarting service in centos container.

  • Welcome to SO. Please could you share the code that is causing the error. – Mike Poole Jul 18 '19 at 08:57
  • [root@5178d5af3f09 /]# systemctl restart httpd.service Failed to get D-Bus connection: Operation not permitted [root@5178d5af3f09 /]# systemctl status httpd.service Failed to get D-Bus connection: Operation not permitted – chetan saini Jul 18 '19 at 10:09

1 Answers1

0

use below command to start the docker container.

docker run -d -it --privileged ContainerId /usr/sbin/init

use docker file from below link for fix this issue. when run the docker image use --privileged.

https://hub.docker.com/_/centos

add these lines to docker file