当前位置:网站首页>容器里用systemctl运行服务报错:Failed to get D-Bus connection: Operation not permitted(解决方法)
容器里用systemctl运行服务报错:Failed to get D-Bus connection: Operation not permitted(解决方法)
2022-07-06 10:01:00 【Dontla】
[[email protected] profile.d]# systemctl start vsftpd.service
Failed to get D-Bus connection: Operation not permitted
[[email protected] profile.d]#
分析原因:
Docker的设计理念是在容器里面不运行后台服务,容器本身就是宿主机上的一个独立的主进程,也可以间接的理解为就是容器里运行服务的应用进程。一个容器的生命周期是围绕这个主进程存在的,所以正确的使用容器方法是将里面的服务运行在前台。
再说到systemd,这个套件已经成为主流Linux发行版(比如CentOS7、Ubuntu14+)默认的服务管理,取代了传统的SystemV风格服务管理。systemd维护系统服务程序,它需要特权去会访问Linux内核。而容器并不是一个完整的操作系统,只有一个文件系统,而且默认启动只是普通用户这样的权限访问Linux内核,也就是没有特权,所以自然就用不了!
因此,请遵守容器设计原则,一个容器里运行一个前台服务!
参考文章:docker出现问题:Failed to get D-Bus connection: Operation not permitted解决方案
解决方法:
需要--privileged与/usr/sbin/init参数共同使用
边栏推荐
- 分布式不来点网关都说不过去
- Cool Lehman has a variety of AI digital human images to create a vr virtual exhibition hall with a sense of technology
- 基于STM32+华为云IOT设计的智能路灯
- Sqoop I have everything you want
- 面试突击63:MySQL 中如何去重?
- 面试突击62:group by 有哪些注意事项?
- Xin'an Second Edition: Chapter 24 industrial control safety demand analysis and safety protection engineering learning notes
- Alertmanager sends the alarm email and specifies it as the Alibaba mailbox of the company
- In terms of byte measurement with an annual salary of 30W, automated testing can be learned in this way
- Xin'an Second Edition: Chapter 12 network security audit technology principle and application learning notes
猜你喜欢

Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter

The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly a hundredfold performance improvement

Awk command exercise
![[getting started with MySQL] fourth, explore operators in MySQL with Kiko](/img/11/66b4908ed8f253d599942f35bde96a.png)
[getting started with MySQL] fourth, explore operators in MySQL with Kiko

Establishment of graphical monitoring grafana

Interview shock 62: what are the precautions for group by?

Kali2021 installation and basic configuration

Cool Lehman has a variety of AI digital human images to create a vr virtual exhibition hall with a sense of technology

EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?

It doesn't make sense without a distributed gateway
随机推荐
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Vscode replaces commas, or specific characters with newlines
重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
C # nanoframework lighting and key esp32
node の SQLite
Spark calculation operator and some small details in liunx
Compile and build, from the bottom to the top
Summary of Android interview questions of Dachang in 2022 (I) (including answers)
OpenCV中如何使用滚动条动态调整参数
Reppoints: advanced order of deformable convolution
基于STM32+华为云IOT设计的智能路灯
Establishment of graphical monitoring grafana
Essai de pénétration du Code à distance - essai du module b
connection reset by peer
FlutterWeb浏览器刷新后无法回退的解决方案
BearPi-HM_ Nano development environment
C# NanoFramework 点灯和按键 之 ESP32
面试突击63:MySQL 中如何去重?
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
Pytest learning ----- pytest operation mode and pre post packaging of interface automation testing