[chef] Re: Custom init.d script not starting


Chronological Thread 
  • From: Hector Castro < >
  • To:
  • Subject: [chef] Re: Custom init.d script not starting
  • Date: Fri, 13 Jan 2012 18:19:44 -0500

Hi Arthur,

From the looks of your template, it appears that you're trying to write an Upstart script.  I would first double-check to make sure that the Chef service provider given your operating system is looking in that directory for init scripts:

http://wiki.opscode.com/display/chef/Resources#Resources-Service

Secondly, I would check to make sure that the PID Upstart is capturing from `inspircd` (you can get this by checking the status of the service) is the same as the one you see in `ps aux | grep inspired`.  Upstart will capture the PID of the parent process (that spawned the daemon) instead of the child process (the actual daemon).

-- 
Hector

On Friday, January 13, 2012 at 5:38 PM, Arthur Kalmenson wrote:

Hello everyone,

I'm building a cookbook that installs InspIRCd from source. It doesn't install an init.d script, so I made my own in templates. However, I'm finding that the call to the service resource doesn't start the IRC server, even though the chef-client output seems to indicate it does. I am, however, able to start it via "sudo /etc/init.d/inspircd start" or "sudo service inspircd start". Here's some code snippets:

inspircd.initd.erb

#!/bin/bash
#
# init.d script for inspircd

su - irc -c "<%= "#{node['inspircd']['install_dir']}" %>/inspircd $*"


default.rb

template "/etc/init.d/inspircd" do
  source "inspircd.initd.erb"
  owner "root"
  group "root"
  mode "0744"
end

service "inspircd" do
  supports :status => true, :restart => true
  action [ :enable, :start ]
end


chef-client output

....
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Processing template[/etc/init.d/inspircd] action create (inspircd::default line 72)
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Processing service[inspircd] action enable (inspircd::default line 79)
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Processing service[inspircd] action start (inspircd::default line 79)
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Chef Run complete in 0.6536 seconds
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Running report handlers
[Fri, 13 Jan 2012 17:29:02 -0500] INFO: Report handlers complete

Any help would be appreciated. Thank you.

All the best,
--
Arthur Kalmenson




Archive powered by MHonArc 2.6.16.

§