2016-01-20 202 views
0

我使用4.3.2廚師客戶食譜,廚師客戶12.6,我的運行列表是 - 角色廚師客戶,我的廚師客戶角色是如下: 廚師客戶端 廚師客戶::配置 廚師客戶端:: delete_validation廚師客戶不以廚師客戶食譜開始RHEL 6.7

鏈接到食譜 - https://github.com/chef-cookbooks/chef-client

我的操作系統是RHEL 6.7

而且,如果它的事項,發生此問題時,我正在使用Packer創建映像。

我登錄到虛擬機,我也無法啓動服務。 在廚師的客戶端運行時,會用下面的 '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:

回答

2

錯誤時使用chef-client食譜,你應該把這個運行中的列表:chef-client::config, chef-client:init_service

在包括config之前,請避免將chef-client放入您的運行列表中,因爲this will create the service before creating the configuration

因此,從您的運行列表中刪除chef-client::default(又名chef-client)。就這樣。如果您願意,您可以使用chef-client::config, chef-client::default, chef-client::delete_validation。但請記住,配置首先。

+0

啊好的。這就說得通了。你也很好地解釋了它。謝謝! – PolarisUser

+1

不客氣;-) – zuazo