sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

Given init system is not used for apparmor starts/restarts #469

Closed WesleyE closed 4 years ago

WesleyE commented 8 years ago

Cookbook version

8.0.2

Chef-client version

Chef: 12.13.37

Platform Details

Ubuntu 16.04 - Scaleway

Scenario:

Installing MySQL with mysql_service, using service_manager 'systemd'

Steps to Reproduce:

mysql_service 'default' do
  version '5.7'
  service_manager 'systemd'
  action [:create, :start]
end

Expected Result:

Installation succeeds

Actual Result:

Installation fails, it cannot find /sbin/status when restarting apparmor. It seems like the init setting is not used during this call. When I add provider Chef::Provider::Service::Systemd to service "#{instance} apparmor" do in mysql_service_base.rb, it goes trough.

klyonrad commented 8 years ago

Isn't this simpy wrong usage? The readme states that you should use the provider option. Besides, on Ubuntu 16, systemd is the default anyway

WesleyE commented 8 years ago

It might be wrong usage, I've tried provider Chef::Provider::MysqlServiceSystemd, but that fails with a constant not set error.

It is the default on Ubuntu 16, yes. But on certain images (the Scaleway one for instance), it still detects Upstart when it is installed but not used. It then fails with an /sbin/status not found error.

klyonrad commented 8 years ago

Ah, I think that's where the documentation is wrong; it might need to be set to Chef::Provider::MysqlServiceManagerSystemd (the class name in the source code, changed in Version 8

WesleyE commented 8 years ago

Using that still fails with

    NameError
    ---------
    uninitialized constant Chef::Provider::MysqlServiceManagerSystemd

Do I need to import something to make that constant work?

tas50 commented 7 years ago

@someara The docs are wrong here right? Seems like things didn't get entirely updated for the service manager stuff.

a7medfahmy94 commented 7 years ago

What is the solution to this ?

geleman commented 7 years ago

This still does not work in 8.2.0

sashman commented 6 years ago

Docs should read:

mysql_service 'default' do
  ...
  provider Chef::Provider::Service::Systemd
  ...
github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

ramereth commented 4 years ago

We are no longer supporting operating systems which still rely on sysvinit.