chef-server stuck ruby_block[supervise_rabbitmq_sleep] action run on Docker container

China☆狼群 提交于 2019-12-08 05:15:39

问题


I have an ubuntu host running docker1.2. On top of it I have created a centos6 container which is running great! When I tried to install chef-server-11.x version it gets stuck here:

  * file[/opt/chef-server/sv/rabbitmq/down] action delete (up to date)
  * link[/opt/chef-server/init/rabbitmq] action create (up to date)
  * link[/opt/chef-server/service/rabbitmq] action create (up to date)
  * ruby_block[supervise_rabbitmq_sleep] action run

After Googling, I found we need to specify platform here in /opt/chef-server/embedded/cookbooks/runit/recipes/default.rb, which I did see following file contains, but it's still not working:

when "centos"
  include_recipe "runit::upstart"

Do I need to specify something else for docker running centos?


回答1:


I have solved above issue:

Because Docker replaces the default /sbin/init with its own, there's no way to run the Upstart init inside a Docker container. However this causes some problems: some Debian packages try to communicate with Upstart, and will fail to install.

Solution:

$sudo dpkg-divert --local --rename --add /sbin/initctl
$sudo ln -s /bin/true /sbin/initctl


来源:https://stackoverflow.com/questions/26614489/chef-server-stuck-ruby-blocksupervise-rabbitmq-sleep-action-run-on-docker-cont

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!