docker Failed to get D-Bus connection 报错 docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
docker Failed to get D-Bus connection 报错
在centos7的容器里面出现了一个BUG,就是serveice启动服务的时候出现报错,不能用service启动服务。
[root@e13c3d3802d0 /]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Failed to get D-Bus connection: Operation not permitted
首先恭喜你使用centos7镜像,然后就是不幸告诉你这个问题是个BUG 将在centos7.2解决。
Currently, systemd in CentOS 7 has been removed and replaced with a fakesystemd package for dependency resolution. This is due to systemd requiring the CAP_SYS_ADMIN capability, as well as being able to read the host's cgroups. If you wish to replace the fakesystemd package and use systemd normally, please follow the steps below.
我查了好多地方都说是个BUG不能解决
有的说创建的时候加上 --privileged选项
我试了这些然而并没有任何的卵用
最后实在是没办法就 rpm -ql 软件包 查看安装的时候有哪些命令在PATH下,用这些命令去启动,这个是一种解决的方法
例如apache的启动就是用命令 httpd
这几天研究了个解决的办法比较靠谱,亲身实测好使:
systemctl start http.service
Failed to get D-Bus connection: No connection to service manager.
这个的原因是因为dbus-daemon没能启动。其实systemctl并不是不可以使用。将你的CMD或者entrypoint设置为/usr/sbin/init即可。会自动将dbus等服务启动起来。
然后就可以使用systemctl了。命令如下:
docker run --privileged -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup centos /usr/sbin/init
Set environment variables (-e, --env, --env-file)
$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash
Use the -e, --env, and --env-file flags to set simple (non-array) environment variables in the container you’re running, or overwrite variables that are defined in the Dockerfile of the image you’re running.
You can define the variable and its value when running the container:
$ docker run --env VAR1=value1 --env VAR2=value2 ubuntu env | grep VAR
VAR1=value1
VAR2=value2
docker Failed to get D-Bus connection 报错 docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash的更多相关文章
- Docker - 解决同步容器与主机时间报错:Error response from daemon: Error processing tar file(exit status 1): invalid symlink "/usr/share/zoneinfo/UTC" -> "../usr/share/zoneinfo/Asia/Shanghai"
问题背景 这里讲解了如何同步容器和主机的时间:https://www.cnblogs.com/poloyy/p/13967532.html 其中使用方法二 docker cp /etc/localti ...
- wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法
内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...
- mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file
mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...
- nagios监控客户端报错/usr/bin/perl^M: bad interpreter: No such file or directory
nagios服务端监控客户端内存时发现监控不上 在客户端直接执行脚本,报错如下: # /usr/local/nagios/libexec/check_memory.pl -w 6% -c 3% -ba ...
- mysql报错“Starting MySQL...The server quit without updating PID file”处理
http://blog.csdn.net/lzq123_1/article/details/51354179 注意:要将/usr/bin/mysql_install_db替换成 /usr/bin/my ...
- salt '*' state.highstate 报错找不到文件,环境如下No Top file or master_tops data matches found.
salt '*' state.highstate 报错找不到文件,环境如下No Top file or master_tops data matches found. file_roots: b ...
- 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了
页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
- 报错:ERROR! The server quit without updating PID file (/usr/local/var/mysql/chenyuntekiMacBook-Air.local.pid).
在Mac上通过brew install mysql 安装了完mysql 执行mysql.server start 报错:ERROR! The server quit without updating ...
- 解决apscheduler报错:Run time of job …… next run at: ……)” was missed by
在Django中使用apscheduler django_apscheduler 实现定时任务, 来完成数据拉取. 一段时间后发现数据量对不上,遂查日志 发现报错如下: Run time of job ...
随机推荐
- 飘逸的python - 不使用keyword,求和1+2+…+n
依据题意,我们不能用到if/else/for/while等keyword. --------------思考中------------ 思路: 1.用递归实现循环 2.递归的终止条件不用if怎么推断呢 ...
- (C++)函数参数传递中的一级指针和二级指针
主要内容: 1.一级指针和二级指针 2.函数指针传递的例子 3.什么时候需要传递二级指针? 4.二级指针在链表中的使用 1.一级指针和二级指针 一级指针:即我们一般说的指针,就是内存地址: 二级指针: ...
- Struts完美解决i18n问题
所谓的i18n问题指的是(软件的)国际化问题,简单来讲就是使我们的软件可以让世界使用任何语言的人们都能使用,软件自身会根据语言环境的不同进行自动配置,如果你是中文环境那界面以中文显示,如果是英文环境就 ...
- 记一发Hive on tez的配置(Hive 3.1.1, Hadoop 3.0.3, Tez 0.9.1)
直接下载Tez的binary包部署安装是有问题的,因为默认支持hadoop版本为2.7,2.7以上的就需要手动编译了. 下载Tez源码 CD到源码文件夹,mvn install -Dhadoop.ve ...
- VB 获取默认打印机的状态
如何获取默认打印机的状态,包括缺纸.卡纸.无连接等状态,还有将某文件打印后,如何得知打印成功? Option ExplicitDeclare Function MapPhysToLin Lib &qu ...
- Linux 监测网络常用的工具sar iftop netstat ping nping fping mtr
Linux 监测网络常用的工具sar iftop netstat ping nping fping mtr # sar -n DEV 1 2 # iftop # netstat -i # ping n ...
- linux 挂载 ISO 文件
sudo sudo mount -o loop SUSE-Linux-10.1-GM-DVD-x86_64.iso /media/cdrom/ sudo umount /media/cdrom
- Apache Ant和Apache Maven的区别
Apache Ant和Apache Maven的区别 分类: ANT Maven 2013-12-10 18:47 1477人阅读 评论(26) 收藏 举报 ———摘自<maven权威指南> ...
- 零基础小白怎么用Python做表格?
用Python操作Excel在工作中还是挺常用的,因为毕竟不懂Excel是一个用户庞大的数据管理软件.本文用Python3!在给大家分享之前呢,小编推荐一下一个挺不错的交流宝地,里面都是一群热爱并在学 ...
- 【转帖】Service Discovery: 6 questions to 4 experts
https://highops.com/insights/service-discovery-6-questions-to-4-experts/ What’s Service Discovery? I ...