当前位置:网站首页>容器里用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
参数共同使用
边栏推荐
- 编译原理——预测表C语言实现
- MySQL 8 sub database and table backup database shell script
- Is it meaningful for 8-bit MCU to run RTOS?
- Sqoop I have everything you want
- Manifest of SAP ui5 framework json
- 李书福为何要亲自挂帅造手机?
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- Remote code execution penetration test - B module test
- PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
- BearPi-HM_ Nano development environment
猜你喜欢
Zen integration nails, bugs, needs, etc. are reminded by nails
【MySQL入门】第三话 · MySQL中常见的数据类型
面试突击62:group by 有哪些注意事项?
The easycvr authorization expiration page cannot be logged in. How to solve it?
Automatic operation and maintenance sharp weapon ansible Foundation
Spark calculation operator and some small details in liunx
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Olivetin can safely run shell commands on Web pages (Part 1)
10 advanced concepts that must be understood in learning SQL
78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
随机推荐
Shell input a string of numbers to determine whether it is a mobile phone number
Alertmanager sends the alarm email and specifies it as the Alibaba mailbox of the company
Sqoop I have everything you want
Automatic operation and maintenance sharp weapon ansible Foundation
Guidelines for preparing for the 2022 soft exam information security engineer exam
[ASM] introduction and use of bytecode operation classwriter class
How to use scroll bars to dynamically adjust parameters in opencv
微信小程序获取手机号
Xin'an Second Edition: Chapter 23 cloud computing security requirements analysis and security protection engineering learning notes
10 advanced concepts that must be understood in learning SQL
Getting started with pytest ----- test case pre post, firmware
BearPi-HM_ Nano development environment
Quick start of Hongmeng system
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
Summary of Android interview questions of Dachang in 2022 (I) (including answers)
Summary of Android interview questions of Dachang in 2022 (II) (including answers)
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
Growth of operation and maintenance Xiaobai - week 7
Flet教程之 13 ListView最常用的滚动控件 基础入门(教程含源码)
Run xv6 system