3

テンプレートをインストールしてからサービスを再起動するレシピがあります...

service "rsyslog" do
  supports :restart => true, :reload => true
  action [:enable, :start]
end 

Chef::Log.info("Creating loggly rsyslog conf")
template "/etc/rsyslog.d/22-loggly.conf" do
  source "syslogd.conf.erb"
  mode "0755"
  owner "root"
  group "root"
  notifies :restart, resources(:service => "rsyslog")
end

なぜ私は得ているのですか:

ERROR: resource template[/etc/rsyslog.d/22-loggly.conf] is configured to notify resource service['rsyslog'] with action restart, but service['rsyslog'] cannot be found in the resource collection. template[/etc/rsyslog.d/22-loggly.conf] is defined in /home/ubuntu/cookbooks/loggly-syslog/recipes/default.rb:7:in `from_file'

[2014-01-03T23:26:37+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

構成ファイルを追加した後、rsyslog を再起動/再ロードするにはどうすればよいですか??

4

1 に答える 1

4

古い通知構文を使用しています。新しい構文に切り替えます。

template '...' do
  notifies :restart, 'service[rsyslog]'
end
于 2014-01-04T00:52:08.830 に答える