当前位置:网站首页>容器里用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参数共同使用
边栏推荐
- Pytest learning ----- pytest confitest of interface automation test Py file details
- OliveTin能在网页上安全运行shell命令(上)
- How to submit data through post
- Unity小技巧 - 绘制瞄准准心
- Nodejs developer roadmap 2022 zero foundation Learning Guide
- Distinguish between basic disk and dynamic disk RAID disk redundant array
- [introduction to MySQL] third, common data types in MySQL
- OpenCV中如何使用滚动条动态调整参数
- The art of Engineering
- [rapid environment construction] openharmony 10 minute tutorial (cub pie)
猜你喜欢

The most complete tcpdump and Wireshark packet capturing practice in the whole network

10 advanced concepts that must be understood in learning SQL

Awk command exercise

【ASM】字节码操作 ClassWriter 类介绍与使用
![[rapid environment construction] openharmony 10 minute tutorial (cub pie)](/img/b5/feb9c56a65c3b07403710e23078a6f.jpg)
[rapid environment construction] openharmony 10 minute tutorial (cub pie)

Pytest learning ----- detailed explanation of the request for interface automation test

Olivetin can safely run shell commands on Web pages (Part 1)

Alibaba brand data bank: introduction to the most complete data bank

Pytest learning ----- pytest operation mode and pre post packaging of interface automation testing

偷窃他人漏洞报告变卖成副业,漏洞赏金平台出“内鬼”
随机推荐
Mysqlimport imports data files into the database
scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
C# NanoFramework 点灯和按键 之 ESP32
Establishment of graphical monitoring grafana
Grafana 9 正式发布,更易用,更酷炫了!
TCP connection is more than communicating with TCP protocol
Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter
Debug xv6
Flet教程之 13 ListView最常用的滚动控件 基础入门(教程含源码)
Growth of operation and maintenance Xiaobai - week 7
中移动、蚂蚁、顺丰、兴盛优选技术专家,带你了解架构稳定性保障
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
Essai de pénétration du Code à distance - essai du module b
偷窃他人漏洞报告变卖成副业,漏洞赏金平台出“内鬼”
Shell input a string of numbers to determine whether it is a mobile phone number
Binary search strategy
Automatic operation and maintenance sharp weapon ansible Foundation
Example of batch update statement combining update and inner join in SQL Server