当前位置:网站首页>容器里用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参数共同使用
边栏推荐
- What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
- The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
- How to solve the error "press any to exit" when deploying multiple easycvr on one server?
- The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
- Mysqlimport imports data files into the database
- Sqoop I have everything you want
- Grafana 9 is officially released, which is easier to use and more cool!
- C语言通过指针交换两个数
- 分布式不来点网关都说不过去
- The NTFS format converter (convert.exe) is missing from the current system
猜你喜欢

Spark accumulator and broadcast variables and beginners of sparksql

【MySQL入门】第三话 · MySQL中常见的数据类型

Getting started with pytest ----- allow generate report

2022年大厂Android面试题汇总(一)(含答案)

在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?

kivy教程之在 Kivy 中支持中文以构建跨平台应用程序(教程含源码)

Pytorch extract middle layer features?

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

一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升

node の SQLite
随机推荐
Nodejs developer roadmap 2022 zero foundation Learning Guide
The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
Pyspark operator processing spatial data full parsing (5): how to use spatial operation interface in pyspark
远程代码执行渗透测试——B模块测试
Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
Debug xv6
Xin'an Second Edition: Chapter 26 big data security demand analysis and security protection engineering learning notes
Alertmanager sends the alarm email and specifies it as the Alibaba mailbox of the company
Zen integration nails, bugs, needs, etc. are reminded by nails
The art of Engineering (3): do not rely on each other between functions of code robustness
Is it meaningful for 8-bit MCU to run RTOS?
BearPi-HM_ Nano development environment
2022年大厂Android面试题汇总(二)(含答案)
[introduction to MySQL] the first sentence · first time in the "database" Mainland
Grafana 9 正式发布,更易用,更酷炫了!
【MySQL入门】第一话 · 初入“数据库”大陆
Automatic operation and maintenance sharp weapon ansible Playbook
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
Mysqlimport imports data files into the database