Is Chef actually using the init scripts? I thought if supports :status => true was set then essentially service pound status was run, and if supports :status => false then Chef checks for a process name (based on the declaration name?). In both cases it should fail?But running service pound status returns an exit code of 3 and there are no processes called 'pound'Same thing happens if I boot up an instance and use chef-client against a Chef server. Says it's starting, says it supports status, says it's running, it's not.chef-apply with the same service declaration works correctly on that instance as well.
[2015-05-12T15:44:11+00:00] DEBUG: service[pound] supports status, running
[2015-05-12T15:44:13+00:00] INFO: service[pound] startedOn Tue, May 12, 2015 at 8:13 AM, Yoshi Spendiff < " target="_blank"> > wrote:The init script already includes /etc/rc.d/init.d/functions, which is the same thing.Why is chef-apply working but not Chef solo?On Mon, May 11, 2015 at 9:12 PM, Fouts, Chris < " target="_blank"> > wrote: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.