Wrong Chef::Provider::Service in Ubuntu 14.04

Bug #1313646 reported by Sergei Antipov
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack + Chef
Won't Fix
Undecided
Unassigned

Bug Description

I don't know why, but in Ubuntu 14.04 all service resources have wrong provider.
For example:
ERROR: service[neutron-server] (openstack-network::common line 130) had an error: Errno::ENOENT: No such file or directory - /etc/init.d/neutron-server restart; ignore_failure is set, continuing

Work only if I set manually provider:
provider Chef::Provider::Service::Upstart

Tags: provider
Revision history for this message
Matt Thompson (mattt416) wrote :

These packages on 14.04 have no /etc/init.d init script provided, and the default service provider on Ubuntu is Chef::Provider::Service::Init::Debian.

There is a bug filed against Ubuntu 14.04's keystone here: https://bugs.launchpad.net/ubuntu/+source/keystone/+bug/1315188

I'm not entirely sure why the change, so will be keeping an eye on that bug to see what the developers say.

Changed in openstack-chef:
status: New → Confirmed
Revision history for this message
Matt Thompson (mattt416) wrote :

I tried adding the following to the openstack-common cookbook:

  if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
         Chef::Platform.set :platform => :ubuntu, :resource => :service, :provider => Chef::Provider::Service::Upstart
  end

That worked except then rabbitmq-server threw an error since that still uses an init script in /etc/init.d. :-/

I've created this blueprint as we'll need to do some work to get these cookbooks working w/ trusty:

https://blueprints.launchpad.net/openstack-chef/+spec/trusty-icehouse

Revision history for this message
Stephan Renatus (s-renatus) wrote :

Matt: when setting node[rabbitmq][job_control] = 'upstart' in openstack-ops-messaging, this particular issue will be gone:
https://github.com/kennonkwok/rabbitmq/blob/master/recipes/default.rb#L48

Revision history for this message
Stephan Renatus (s-renatus) wrote :

https://tickets.opscode.com/browse/CHEF-5276 Starting with chef-client version 11.14.0, the default service provider for Upstart 13.10+ will be Chef::Provider::Service::Upstart.

So there's no real need to workaround when you bump the least supported client version for the use with Ubuntu 14.04....

Revision history for this message
Matt Thompson (mattt416) wrote :

Hi Stephan,

That's good to hear. I believe we'll still have to switch apache2 back to init as last I checked that had no upstart script. That should be relatively straightforward to do though.

-Matt

Revision history for this message
Stephan Renatus (s-renatus) wrote :

Created an issue for the apache2 cookbook: https://github.com/onehealth-cookbooks/apache2/issues/150 and for rabbitmq: https://github.com/kennonkwok/rabbitmq/pull/126

When these are fixed, our dependencies updated and the new version of chef-client is released, this issue should be solved. ;)

Revision history for this message
Paul Czarkowski (paulcz) wrote :

You can monkeypatch it in a wrapper cookbook like this -

if node[:platform] == 'ubuntu' && node[:platform_version] == '14.04'
  ['keystone','neutron-server', ....].each do |monkey_patch|
    svc = resources(service: monkey_patch)
    svc.provider(::Chef::Provider::Service::Upstart)
  end
end

Changed in openstack-chef:
milestone: none → juno-rc1
Revision history for this message
JJ Asghar (d-jj) wrote :

This will be resolved via the chef-client 12 update.

Changed in openstack-chef:
status: Confirmed → Won't Fix
Revision history for this message
Edmund Haselwanter (ehaselwanter) wrote :

I can confirm that this can be closed once chef-client 12 is used. rc releases

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.