【发布时间】:2014-01-21 18:30:36
【问题描述】:
我有一个应该安装模板的配方,然后重新启动服务...
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 重新启动/重新加载??
【问题讨论】:
-
我刚刚写了一个答案,但是您确定服务资源的定义与您列出的完全一样吗?
-
我问,因为你可能会遇到我在这里描述的错误:*.com/questions/18370804/…
标签: chef-infra chef-recipe rsyslog