Giter Club home page Giter Club logo

Comments (9)

bflad avatar bflad commented on August 15, 2024
docker_container "name" do
  # ...
  action :stop
end

already does the behavior you mentioned to make writing your cookbooks easy. Here's the code in case you're more curious: https://github.com/bflad/chef-docker/blob/master/providers/container.rb#L96

Let me know if you have additional questions or if its not behaving as expected.

from docker.

mickelsonm avatar mickelsonm commented on August 15, 2024

I just tried this:

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

It doesn't appear to be working as I would expect. Here's the output I got from the test:

Recipe: deployment::none
  * service[webapp] action stop
================================================================================
Error executing action `stop` on resource 'service[webapp]'
================================================================================


Errno::ENOENT
-------------
No such file or directory - /sbin/status webapp


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
  provider Chef::Provider::Service::Upstart
  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

from docker.

bflad avatar bflad commented on August 15, 2024

Which OS are you on? No such file or directory - /sbin/status seems to imply Upstart isn't installed correctly.

from docker.

mickelsonm avatar mickelsonm commented on August 15, 2024

Debian 7, Linux app3 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux

from docker.

bflad avatar bflad commented on August 15, 2024

Ah yeah, Debian uses SysV (init_type sysv in this cookbook) by default. Although the docker_container sysv script is there, no one has contributed an init script for the daemon yet (guess I'll add this to my to-do list tonight). If you're stuck on using Upstart, I believe you need to install the Debian upstart package. I'm not sure if this cookbook should handle that for you by default as it seems outside its duties.

from docker.

bflad avatar bflad commented on August 15, 2024

https://packages.debian.org/wheezy/upstart
https://packages.debian.org/wheezy/amd64/upstart/filelist

from docker.

mickelsonm avatar mickelsonm commented on August 15, 2024

Thanks for the good information. I am a bit hesitant on adding in upstart when I am planning on using runit, which goes along with issue #72 . Any chance you could incorporate runit into the list for docker functionalities? Thanks.

from docker.

bflad avatar bflad commented on August 15, 2024

I'm looking at all the runit documentation now. Should have an initial runit setup hopefully tonight.

from docker.

mickelsonm avatar mickelsonm commented on August 15, 2024

Thanks man! Definitely looking forward to 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.