Ubuntu – restarting php5-fpm on ubuntu 14.04 with chef

chef-solophp-fpmUbuntuupstart

I have this in my chef recipe:

service 'php5-fpm' do
  supports :restart => true
  action [ :enable, :start ]
end

However my recipe now barfs in Ubuntu 14.04, as "/etc/init.d/php5-fpm restart" does not work on Ubuntu 14.04 (it returns with 1 and there is no message).

How do I get my chef recipe to restart and manage the php5-fpm service?

Best Answer

Solved by adding the following to my service in chef:

"provider Chef::Provider::Service::Upstart"

This is really going to start getting annoying when some services let you use init.d and others force you to use upstart.