[chef] Re: service resource not creating a file


Chronological Thread 
  • From: John Dyer < >
  • To:
  • Subject: [chef] Re: service resource not creating a file
  • Date: Sun, 27 May 2012 11:43:55 -0400

Hello Sachin,

  The service resource doesn't actually deploy anything to /etc/init.d, its actually just designed to manage the service.  If you check the docs it doesn't actually say it puts a file in /etc/init.d, rather it says it uses the file at /etc/init.d ( eg:  /etc/init.d/service_name), but the does needs to actually exist prior to this call.  What you probably want to do is deploy a template to /etc/init.d just before you call your service resource ( https://gist.github.com/2814835 ).

Hope that helps!

-John

On Sun, May 27, 2012 at 11:19 AM, Sachin Sagar Rai < " target="_blank"> > wrote:

Hi Chefellas,

I have the following service resource defined in my recipe.

    service "unicorn_#{app['id']}" do
      provider Chef::Provider::Service::Init::Debian
      start_command "#{app['deploy_to']}/shared/scripts/unicorn start"
      stop_command "#{app['deploy_to']}/shared/scripts/unicorn stop"
      restart_command "#{app['deploy_to']}/shared/scripts/unicorn restart"
      status_command "#{app['deploy_to']}/shared/scripts/unicorn status"
      supports :start => true, :stop => true, :restart => true, :status => true
      action :nothing
    end

According to the docs at wiki http://wiki.opscode.com/display/chef/Resources#Resources-Service, it should create a file at `/etc/init.d/unicorn_myapp` file.

But its not creating that file.

I'm on chef-0.10.8 with ruby19

What might be wrong?

-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow





Archive powered by MHonArc 2.6.16.

§