Chef-client daemon terminates when change interval

I’m having a problem with a node where chef-client stops running after I
change its interval.

It seems this is being caused by the fact that I have a resource being
executed after the chef-client is restarted.

I reproduced the problem with the following:

run_list: chef-client, automateinsights::test

Where test.rb is:

Start the service

service “automateinsights” do
provider Chef::Provider::Service::Upstart
supports :restart => true, :start => true, :stop => true
action [:restart]
end

run the delayed command

execute “after restart” do
command "echo delayed command"
action :nothing
subscribes :run, "service[automateinsights]"
end

Any change to chef_client.interval causes the chef-client daemon to
terminate.

Any suggestions for how I can avoid this problem? What the runlist is
actually doing is deploying an application, restarting the service, and
then running some automated regression tests on it (the delayed command).

Thanks!
Christine

On Thursday, November 6, 2014 at 4:42 PM, Christine Draper wrote:

I'm having a problem with a node where chef-client stops running after I change its interval.

It seems this is being caused by the fact that I have a resource being executed after the chef-client is restarted.

I reproduced the problem with the following:

run_list: chef-client, automateinsights::test

Where test.rb is:

Start the service

service "automateinsights" do
provider Chef::Provider::Service::Upstart
supports :restart => true, :start => true, :stop => true
action [:restart]
end

run the delayed command

execute "after restart" do
command "echo delayed command"
action :nothing
subscribes :run, "service[automateinsights]"
end

Any change to chef_client.interval causes the chef-client daemon to terminate.

Any suggestions for how I can avoid this problem? What the runlist is actually doing is deploying an application, restarting the service, and then running some automated regression tests on it (the delayed command).

Thanks!
Christine

Sounds like this could be a bug in the chef-client cookbook. Are you using the latest version? Have you checked the cookbook’s issues for anything similar?

--
Daniel DeLeo

I'm on the latest cookbook. Hunted around and I am guessing it is related
to this problem https://github.com/opscode/chef/issues/1524with
chef-client on Ubuntu 12.04 with the default initd. I'll try switching to
upstart.

On Fri, Nov 7, 2014 at 9:46 AM, Daniel DeLeo dan@kallistec.com wrote:

On Thursday, November 6, 2014 at 4:42 PM, Christine Draper wrote:

I'm having a problem with a node where chef-client stops running after I
change its interval.

It seems this is being caused by the fact that I have a resource being
executed after the chef-client is restarted.

I reproduced the problem with the following:

run_list: chef-client, automateinsights::test

Where test.rb is:

Start the service

service "automateinsights" do
provider Chef::Provider::Service::Upstart
supports :restart => true, :start => true, :stop => true
action [:restart]
end

run the delayed command

execute "after restart" do
command "echo delayed command"
action :nothing
subscribes :run, "service[automateinsights]"
end

Any change to chef_client.interval causes the chef-client daemon to
terminate.

Any suggestions for how I can avoid this problem? What the runlist is
actually doing is deploying an application, restarting the service, and
then running some automated regression tests on it (the delayed command).

Thanks!
Christine

Sounds like this could be a bug in the chef-client cookbook. Are you using
the latest version? Have you checked the cookbook’s issues for anything
similar?

--
Daniel DeLeo