CentOS7 1611 runs Docker and uses systemctl start httpd.service to resolve errors

CentOS7 1611 runs Docker and uses systemctl start httpd.service to report an error as shown below
screenshot
Error message: Failed to get D-BUS connection: Operation no permitted

Adding the --privileged option at runtime still doesn't help.
screenshot

Some netizens said that dbus-daemon failed to start. Systemctl is not unusable. Set CMD or entrypoint to /usr/sbin/init. The docker container will automatically start services such as dbus. However, the container is stuck.
screenshot

Baidu crashed for a whole circle, and then tried the -d parameter, haha ​​it was OK.
screenshot

This issue is also described in the CentOS repo document of GITHUB, to the effect that CentOS7 systemd does not start by default.https://github.com/docker-library/docs/tree/master/centos#systemd-integration
The following picture is a solution provided by foreign friends. Mount the /sys/fs/cgroup directory to the container's /sys/fs/cgroup directory and configure read-only permissions, but the docker run command can only use the -d parameter, not the -it Parameter, using -it parameter will still get stuck.
screenshot

Intelligent Recommendation

Centos7 uses systemctl

My blog homepage:Written blog Systemctl is the main tool in CentOS7's service management tool, which combines the functions of the previous service and chkconfig. Reprinted at: https://www.jianshu.com...

CentOS7 SystemCTL Start Redis Failure

  I found that there is a mistake in line 81 Seeing the 81st, when the redis permissions just opened ① Comment on this line of Bind 127.0.0.1; ② PROTECTED-MODE is set to NO When I did the second ...

CENTOS7-Command-SystemCTL Start Firewalld

CENTOS7 opens the firewall command Centos7 is installed by defaultfirewalld Tool Put on the firewall command...

Centos7 systemctl uses a custom service

Service directory: Reload the service file: Boot from the start: Xxx is the service file name start up: stop: Restart: View status: Status can see the output of the script pid, etc. example 1: start-a...

Centos7 uses systemctl to control nginx

1. Create nginx.service 2. Edit the following content 3. Make the document effective 4. Start nginx Turn off nginx Restart nginx 5. Boot up...

More Recommendation

Docker cannot start (SystemCTL Start Docker failed)

Docker cannot start a fault investigation daemon.json configuration error hosts configuration Investigation method: daemon.json configuration error hosts configuration The hosts configuration in Daemo...

CentOS7 uses Docker to start Redis service

I tried it as early as when Docker was hot, because the cloud at that time was still chaotic, but the current form of cloud is relatively mature, so I personally think that the role of docker is not s...

Centos7 runs with Docker CE

table of Contents The first step is to prepare the Centos 7 system. I started using PuTTY. Centos7 Mirror Accelerator [Modified Official Post] Docker related commands View all images `docker images` V...

Centos7-docker runs gitlab

Centos7-docker runs gitlab 1. Prepare the configuration file gitlab.rb in the /gitlab/config folder 2. Execute the docker command to configure the startup container 3. If you have opened port 5556, yo...

Docker runs CENTOS7 container

Maverick test knife: Docker runs CentOS7 container command -T and containers for command interaction -i continuous and container interaction to prevent disconnection View local mirror docker image ls ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top