ambakshi / docker-perforce

Docker Perforce Images (p4d, perforce-swarm, git-fusion, sample depot, and a base image)
115 stars 56 forks source link

Failed to get D-Bus connection: Operation not permitted #11

Open kabamwboyer opened 5 years ago

kabamwboyer commented 5 years ago

Originally I encountered the error:

/run.sh: line 5: service: command not found

Upon a suggestion in a comment from this issue, I added the following to the Dockerfile:

RUN yum -y install initscripts && yum clean all

However, I now encounter the following error: Failed to get D-Bus connection: Operation not permitted

The full log is as follows:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Redirecting to /bin/systemctl start rsyslog.service
Failed to get D-Bus connection: Operation not permitted
/run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

This is a known issue with running CentOS Docker containers... Is there another way to run rsyslog and crond? Are these necessary to the core functioning of Helix Swarm? Thank you for your time and help!

kabamwboyer commented 5 years ago

In the Helix Swarm docs, they advise to use systemctl:

For CentOS 7 to use systemd scripts: systemctl restart httpd24-httpd

Therefore, I have attempted to use systemctl to start rsyslog and crond:

systemctl start rsyslog                                                         
systemctl start crond

However I get the same error:

van-wboye01-mac:perforce-server wboyer$ docker run --rm -p 80:80 -p 443:443 --name swarm --network=helix-bridge-network ambakshi/perforce-swarm:latest 
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Failed to get D-Bus connection: Operation not permitted
/run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
ambakshi commented 5 years ago

You're totally right that's way busted :/ You don't need those services in the container so for the time being you can just comment them out. I'll have a partial fix here locally, and will try to have it fixed by this weekend. Thanks for reporting!

kabamwboyer commented 5 years ago

Hey @ambakshi ! I managed to get things working by running supervisor as the entrypoint and getting it to run both cron and the run.sh... Do you want me to send you any gists or to do a PR?

ambakshi commented 5 years ago

Hey, I think I've fixed all those issues. Please give it another try. crond and systemctl should be working now. Thanks and sorry for the delay!

kabamwboyer commented 5 years ago

Hey @ambakshi ! I'll be able to get to testing this fix by Wednesday; is that timeline ok for you?

ambakshi commented 5 years ago

Yes of course! Anytime.