简体   繁体   English

Chef-Client并非以Chef-Client Cookbook RHEL 6.7开头

[英]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 我正在使用4.3.2 Chef-Client Cookbook,Chef-Client 12.6,我的运行列表是-角色Chef-Client,我的Chef-Client角色如下:Chef-clientchef-client :: config Chef-client :: delete_validation

Link to the cookbook - https://github.com/chef-cookbooks/chef-client 链接到食谱-https: //github.com/chef-cookbooks/chef-client

My os is rhel 6.7 我的操作系统是rhel 6.7

Also, if it matters, I am using Packer to create the image when this issue occurs. 另外,如果有问题,发生此问题时,我将使用Packer创建映像。

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: 在Chef-client运行期间,它将出现以下'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:错误'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: '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:

When using the chef-client cookbook you should put this in your run list: chef-client::config, chef-client:init_service . 使用chef-client Cookbook时,应将其放入运行列表中: 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 . 避免在包含config之前将chef-client放入运行列表中,因为这将在创建配置之前创建服务

So, remove chef-client::default (aka chef-client ) from your run list. 因此,从运行列表中删除chef-client::default (又名chef-client )。 That's all. 就这样。 You can use chef-client::config, chef-client::default, chef-client::delete_validation if you prefer. 如果愿意chef-client::config, chef-client::default, chef-client::delete_validation可以使用chef-client::config, chef-client::default, chef-client::delete_validation But remember, the config goes first. 但是请记住,配置优先。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM