当前位置:网站首页>容器里用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
- Unity tips - draw aiming Center
- [translation] principle analysis of X Window Manager (I)
- C语言通过指针交换两个数
- How to solve the error "press any to exit" when deploying multiple easycvr on one server?
- The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
- Kali2021 installation and basic configuration
- MySQL stored procedure
- 李书福为何要亲自挂帅造手机?
- 李書福為何要親自掛帥造手機?
猜你喜欢
sql语句优化,order by desc速度优化
PyTorch 提取中间层特征?
【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
Pytorch extract middle layer features?
[introduction to MySQL] third, common data types in MySQL
Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter
Is it meaningful for 8-bit MCU to run RTOS?
【MySQL入门】第一话 · 初入“数据库”大陆
It doesn't make sense without a distributed gateway
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
随机推荐
Kernel link script parsing
微信小程序中给event对象传递数据
微信小程序获取手机号
酷雷曼多种AI数字人形象,打造科技感VR虚拟展厅
node の SQLite
Reppoints: advanced order of deformable convolution
The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly a hundredfold performance improvement
BearPi-HM_ Nano development environment
Nodejs developer roadmap 2022 zero foundation Learning Guide
adb常用命令
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
Debug and run the first xv6 program
Xin'an Second Edition: Chapter 25 mobile application security requirements analysis and security protection engineering learning notes
远程代码执行渗透测试——B模块测试
分布式(一致性协议)之领导人选举( DotNext.Net.Cluster 实现Raft 选举 )
Distributed (consistency protocol) leader election (dotnext.net.cluster implements raft election)
scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
Fleet tutorial 13 basic introduction to listview's most commonly used scroll controls (tutorial includes source code)
Pourquoi Li shufu a - t - il construit son téléphone portable?
Why should Li Shufu personally take charge of building mobile phones?