On top of the script in /etc/init.d that starts the service, try adding the following line
. /etc/init.d/function
ChrisSent from my iPad using Mail+ for Outlook
From: Yoshi Spendiff
Sent: 5/11/15, 9:57 PM
To: chef
Subject: [chef] Not detecting service start failureCheersWhat am I missing?There are no processes called pound running on the system and there are no other service declarations called pound in all of my cookbooks.The pound init script is set up to run correctly, a non-zero exit code is returned on unsuccessful start of pound.If I put the above service declaration into a test file and run it with chef-apply then it fails as it should:This are my recipe declaration:Hi,I'm having trouble understanding why Chef isn't detecting that a service is failing to start. I'm attempting to get Pound (proxy) to work. The package installs fine and I have a service declaration that says the service is started when it's not. I'm running via chef solo at the moment (it's a vagrant box) and running a chef-solo run with debug logging produces the following:
[2015-05-12T01:45:50+00:00] DEBUG: service[pound] you have specified a status command, running..
pound is stopped
pound 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Starting Pound: starting...
[FAILED]
Starting Pound: starting...
[FAILED]
Starting Pound: starting...
[FAILED]
Starting Pound: starting...
[FAILED]
Starting Pound: starting...
[FAILED]
[2015-05-12T01:45:52+00:00] INFO: service[pound] started
- start service service[pound]
I have tried using the init_command and status_command options, as well as disabling and enabling the supports :status => true option
# Install pound and deploy configuration file from template
package 'Pound' do
options '--enablerepo=epel'
end
template '/etc/pound.cfg' do
source 'pound.cfg.erb'
mode 0644
end
service 'pound' do
supports :restart => false, :reload => false, :status => true
action [:start, :enable]
end
[2015-05-12T01:56:28+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: service[pound] ((chef-apply cookbook)::(chef-apply recipe) line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /sbin/service pound start ----
STDOUT: Starting Pound: [FAILED]
STDERR: starting...
---- End output of /sbin/service pound start ----
Ran /sbin/service pound start returned 1
Archive powered by MHonArc 2.6.16.