Docker Community Forums

Share and learn in the Docker community.

Failed to get D-Bus connection: Operation not permitted


(Paulfrench) #1

Client:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: windows/amd64

Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: linux/amd64

I’m very new to docker but I have been following very carefully a few examples to get an oracle xe database running on top of oraclelinux. Everything is great apart from the last step. All I need to do is start oracle as part of my image. In my dockerfile I have tried

CMD /etc/init.d/oracle-xe start
CMD ["/etc/init.d/oracle-xe" ,“start”]

So when I start my docker container based on my built image I get the error…

Failed to get D-Bus connection: Operation not permitted
Starting oracle-xe (via systemctl): [FAILED]

However if I run my docker container and override the CMD e.g.

docker run -it --shm-size=“2g” me/oraclexe /bin/bash

…so that I get an interactive bash shell, I can then simply enter in the shell…

[root@e8bb69e68f43 /]# /etc/init.d/oracle-xe start

…and my oracle database starts fine where I do not get any errors.

I’m really struggling to see what the issue is? Any help/pointers would be appreciated. Thanks!!


(Paulfrench) #2

Don’t worry looking at this, it looks like it is a non-docker issue.


(Paulfrench) #3

Okay worked it out. I required the -d option to run the process in the background, this stopped the error “Failed to get D-Bus connection: Operation not permitted”. However the container still just stopped once oracle had started (i.e. the process as pid 1 had completed) so I had to make sure this did not happen by starting oracle (/etc/init.d/oracle-xe start) in a shell script and put the script in an infinite loop with a sleep command in their to stop it completing and now all is good.

Their must be a standard way of running docker containers in the background and keep them running? Is there a better way then what I have done?


(Michael Friis) #4

You should check to see if oracle-xe has a way to run in interactive mode (eg. not in the background). Also check out how some of the other database images are built: https://github.com/docker-library/mysql/blob/9f95658f528699d2c2017ca42ad163a9d5c5e7c1/5.7/Dockerfile


(Aditya21) #5

Failed to get D-Bus connection: Operation not permitted
i got similar result when i want to install jenkins on Centos image on my Mac. Any help appreciated.


(Pratikdocker310) #6

hi facing same please help
thanks in advance


(Labins) #7

I am facing similary issue when starting httpd service in container.

[root@891c24ae8ee6 html]# systemctl start httpd.service
Failed to get D-Bus connection: Operation not permitted


(Ricardo Saracino) #8

Same here, did you resolve this


(Labins) #9

Still trying…found some where in google “# docker run -d -it --privileged /usr/sbin/init” Need to play around and see if that helps, will update shortly.


(Labins) #10

If found the solution… I don’t know how you have written your docker file, but please append following entry in your dockerfile

ENTRYPOINT ["/usr/sbin/init"]

Once container is up executed following command:

docker exec -it top

you must see systemd with PID 1


(Labins) #11

I found the solution… I don’t know how you have written your docker file, but please append following entry in your dockerfile

ENTRYPOINT ["/usr/sbin/init"]

Once container is up executed following command:

docker exec -it top

you must see systemd with PID 1
[/quote]