----
Chef! Where is my Ubuntu 14.04 service support?
// Chef Blog
So you've decided to update or use Ubuntu 14.04 LTS. You've probably started leveraging Chef in some awesome way. The problem is, you put in a nice little service
Resource and see something like:
Chef::Exceptions::Exec ---------------------- /usr/sbin/update-rc.d <some_awesome_service> defaults returned 1, expected 0
This is frustrating because Ubuntu 14.04 decided to ship with two different init systems. Upstart is the default init system, but most services are still in the SysV init. The tl;dr, if you have a service Resource that fails with something like the above error you can add the Provider like this:
If you're Ubuntu 14.04 only:
service "some_awesome_service" do provider Chef::Provider::Service::Upstart supports :restart => true action [:enable,:start] end
service "some_awesome_service" do case node["platform"] when "ubuntu" if node["platform_version"].to_f >= 14.04 provider Chef::Provider::Service::Upstart end end action [:enable, :start] supports :restart => true end
We'd like to tip our hat to a community member: Matthew McMillan for his post about a work around for this issue. We've leveraged it a few places, and it's the current best short term answer.
Ubuntu 14.04 is going to be around until at least April 2019, and we are trying to figure out the correct solution. Let's continue discussing this at the Chef Summit, or you're more than welcome to comment on the RFC.
----
Shared via my feedly reader
No comments:
Post a Comment