加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

docker – 在容器中运行服务(upstart/init.d)

发布时间:2020-12-16 03:43:57 所属栏目:安全 来源:网络整理
导读:我正在尝试在docker中启动一个具有许多init和upstart服务的系统,我得到了这个错误. initctl: Unable to connect to Upstart:Failed to connect to socket /com/ubuntu/upstart: Connection refused 所有的解决方法都建议与/ bin / true建立硬链接以使错误无

我正在尝试在docker中启动一个具有许多init和upstart服务的系统,我得到了这个错误.

initctl: Unable to connect to Upstart:
Failed to connect to socket /com/ubuntu/upstart: Connection refused

所有的解决方法都建议与/ bin / true建立硬链接以使错误无效.但我需要让upstart管理这些服务以实现restart-ability和upstart发出事件才能工作……

因为似乎docker不支持这个,我正在考虑编写脚本以启动/etc/rcX.d中的所有服务并跟踪PID的严重破解.这并不能解决来自暴发户的缺乏发射事件的问题.

有关如何在docker中启动新手进程的任何其他想法?

最佳答案
不幸的是,upstart在docker容器中不起作用,因为它们对init系统有些神奇.

这issue说明:

If your application uses upstart,this wont fit well in bare docker images,and even more if they divert /sbin/init or
/sbin/initctl to something like /bin/true or /dev/null.
You application may use service to start if this one has an old school systemV initscript and if the initctl command has not been
diverted.

In the case of salt-minion,on ubuntu the packaging uses an upstart
job and no classical init script so it is normal that it wont start in
both cases.

而this one说:

Because Docker replaces the default /sbin/init with its own,there’s
no way to run the Upstart init inside a Docker container.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读