PolarisUser
PolarisUser

Reputation: 739

chef-client not starting with chef-client cookbook RHEL 6.7

I am using the 4.3.2 chef-client cookbook, chef-client 12.6, and my run list is - role chef-client, and my chef-client role is as follows: chef-client chef-client::config chef-client::delete_validation

Link to the cookbook - https://github.com/chef-cookbooks/chef-client

My os is rhel 6.7

Also, if it matters, I am using Packer to create the image when this issue occurs.

I log-on to the VM, and I am unable to start the service either. During the chef-client run, it will error with the following 'mazon-ebs: ================================================================================ amazon-ebs: Error executing action `start` on resource 'service[chef-client]' amazon-ebs: ================================================================================ amazon-ebs: amazon-ebs: Mixlib::ShellOut::ShellCommandFailed amazon-ebs: ------------------------------------ amazon-ebs: Expected process to exit with [0], but received '6' amazon-ebs: ---- Begin output of /sbin/service chef-client start ---- amazon-ebs: STDOUT: amazon-ebs: STDERR: amazon-ebs: ---- End output of /sbin/service chef-client start ---- amazon-ebs: Ran /sbin/service chef-client start returned 6 amazon-ebs: amazon-ebs: Resource Declaration: amazon-ebs: --------------------- amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb amazon-ebs: amazon-ebs: 32: service 'chef-client' do amazon-ebs: 33: supports :status => true, :restart => true amazon-ebs: 34: action [:enable, :start] amazon-ebs: 35: end amazon-ebs: amazon-ebs: Compiled Resource: amazon-ebs: ------------------ amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in `from_file' amazon-ebs: amazon-ebs: service("chef-client") do amazon-ebs: action [:enable, :start] amazon-ebs: updated true amazon-ebs: supports {:status=>true, :restart=>true} amazon-ebs: retries 0 amazon-ebs: retry_delay 2 amazon-ebs: default_guard_interpreter :default amazon-ebs: service_name "chef-client" amazon-ebs: enabled true amazon-ebs: pattern "chef-client" amazon-ebs: declared_type :service amazon-ebs: cookbook_name "chef-client" amazon-ebs: recipe_name "init_service" amazon-ebs: end amazon-ebs: amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: Running queued delayed notifications before re-raising exception amazon-ebs: [2016-01-20T16:49:04-05:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed) amazon-ebs: * service[chef-client] action restart[2016-01-20T16:49:04-05:00] INFO: Processing service[chef-client] action restart (chef-client::init_service line 32) amazon-ebs: amazon-ebs: amazon-ebs: ================================================================================ amazon-ebs: Error executing action `restart` on resource 'service[chef-client]' amazon-ebs: ================================================================================ amazon-ebs: amazon-ebs: Mixlib::ShellOut::ShellCommandFailed amazon-ebs: ------------------------------------ amazon-ebs: Expected process to exit with [0], but received '6' amazon-ebs: ---- Begin output of /sbin/service chef-client restart ---- amazon-ebs: STDOUT: Stopping chef-client: [FAILED] amazon-ebs: STDERR: amazon-ebs: ---- End output of /sbin/service chef-client restart ---- amazon-ebs: Ran /sbin/service chef-client restart returned 6 amazon-ebs: amazon-ebs: Resource Declaration: amazon-ebs: --------------------- amazon-ebs: # In /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb amazon-ebs: amazon-ebs: 32: service 'chef-client' do amazon-ebs: 33: supports :status => true, :restart => true amazon-ebs: 34: action [:enable, :start] amazon-ebs: 35: end amazon-ebs: amazon-ebs: Compiled Resource: amazon-ebs: ------------------ amazon-ebs: # Declared in /var/chef/cache/cookbooks/chef-client/recipes/init_service.rb:32:in from_file amazon-ebs: amazon-ebs: service("chef-client") do amazon-ebs: action [:enable, :start] amazon-ebs: updated true amazon-ebs: supports {:status=>true, :restart=>true} amazon-ebs: retries 0 amazon-ebs: retry_delay 2 amazon-ebs: default_guard_interpreter :default amazon-ebs: service_name "chef-client" amazon-ebs: enabled true amazon-ebs: pattern "chef-client" amazon-ebs: declared_type :service amazon-ebs: cookbook_name "chef-client" amazon-ebs: recipe_name "init_service" amazon-ebs: end amazon-ebs: amazon-ebs:

Upvotes: 0

Views: 510

Answers (1)

zuazo
zuazo

Reputation: 5758

When using the chef-client cookbook you should put this in your run list: chef-client::config, chef-client:init_service.

Avoid putting chef-client in your run list before including the config, because this will create the service before creating the configuration.

So, remove chef-client::default (aka chef-client) from your run list. That's all. You can use chef-client::config, chef-client::default, chef-client::delete_validation if you prefer. But remember, the config goes first.

Upvotes: 2

Related Questions