Giter Club home page Giter Club logo

Comments (6)

bflad avatar bflad commented on July 17, 2024

First of all, I should add runit support for you so you don't have to manually do this. Should be fairly doable with how I have things setup correctly and can support both the docker daemon and docker_container resources.

I'd highly recommend using the Chef community runit cookbook: https://github.com/hw-cookbooks/runit, which is what I'd base any implementation of mine on (using the runit_service resource). The Heavy Water folks and contributors have already done most, if not all, of the heavy lifting for runit!

Hope this helps. Will keep open until runit support is added.

from docker.

mickelsonm avatar mickelsonm commented on July 17, 2024

Thanks for the help and willingness to extend the existing functionality. I have the runit cookbook being used as a dependency for my web server (Nginx), so I guess I have looked into it somewhat, but was stumbling to try to figure out how to get it to work with the chef-docker cookbook. I definitely am looking forward to this new functionality!

from docker.

bflad avatar bflad commented on July 17, 2024

Released initial support for runit in 0.31.0 of the cookbook. Set your init_type or container_init_type attributes to runit and hopefully this will get you started.

from docker.

mickelsonm avatar mickelsonm commented on July 17, 2024

I just started testing Runit again. I set the "container_init_type": "runit". When I run my recipe a second time and when it hits the section for stopping a container it errors out.

I have the following to stop a potential running container:

docker_container "#{app.name}" do
  action :stop
end

Error I get:

Recipe: deployment::none
  * service[webapp] action stop
    * /etc/init.d/webapp does not exist!
================================================================================
Error executing action `stop` on resource 'service[webapp]'
================================================================================


Chef::Exceptions::Service
-------------------------
/etc/init.d/webapp does not exist!


Resource Declaration:
---------------------
# In /home/deployer/chef-solo/cookbooks-2/docker/providers/container.rb

238:   service service_name do
239:     case new_resource.init_type
240:     when 'systemd'
241:       provider Chef::Provider::Service::Systemd
242:     when 'upstart'
243:       provider Chef::Provider::Service::Upstart
244:     end
245:     supports :status => true, :restart => true, :reload => true



Compiled Resource:
------------------
# Declared in /home/deployer/chef-solo/cookbooks-2/docker/providers/container.rb:238:in `service_action'

service("webapp") do
  action [:stop]
  supports {:status=>true, :restart=>true, :reload=>true}
  retries 0
  retry_delay 2
  service_name "webapp"
  pattern "webapp"
  cookbook_name :"deployment"
  recipe_name "none"
end

Any ideas or things I need to set to get this to work in my Debian 7 environment? Thanks!

from docker.

bflad avatar bflad commented on July 17, 2024

@mickelsonm are you still having trouble with runit?

from docker.

mickelsonm avatar mickelsonm commented on July 17, 2024

@bflad : Hey thanks for the follow-up! Unfortunately,I wasn't able to get it to go. I am trying to remember what I tried (month ago...sorry), but I do remember setting "container_init_type": "runit", which partially worked the first time I ran my deployment script, but on the second time it raised the error I mentioned.Not really sure on the how or why without re-testing it.

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.