chef-server stuck ruby_block[supervise_rabbitmq_sl

2019-06-04 17:07发布

问题:

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