In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to solve the error caused by starting the service with systemctl in docker? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Docker version:
[root@localhost gae_proxy] # docker versionClient: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.centos.10.x86_64 Go version: go1.6.3 Git commit: d381c64-unsupported Built: Thu Aug 4 13:21:17 2016 OS/Arch: linux/amd64Server: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3 -46.el7.centos.10.x86_64 Go version: go1.6.3 Git commit: d381c64-unsupported Built: Thu Aug 4 13:21:17 2016 OS/Arch: linux/amd64
Mirror version
[root@b2ca5610d3da /] # cat / etc/redhat-releaseCentOS Linux release 7.2.1511 (Core)
When you start a service through systemctl in docker, you always report an error such as Failed to get D-Bus connection: Operation not permitted.
[root@25d27693a24d ~] # systemctl start sshdFailed to get D-Bus connection: Operation not permitted
The solution is to run / usr/sbin/init on docker run. For example:
[root@localhost /] # docker run-tid-- name hadoopbase centos/hadoopbase:v001 / usr/sbin/init
In this way, the running container can use systemctl to start the service. Some people say that the problem of running an error through systemctl has been solved in CentOS7.2, but I still encounter this problem in practice.
Another solution is to execute the command / usr/sbin/init through CMD when generating an image file through Dockerfile, that is, CMD ["/ usr/sbin/init"]
This is the answer to how to solve the problem when using systemctl to start the service in docker. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.