Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using service name 'default' results in stop/disable/enable/start actions on every run #615

Open
piloos opened this issue Jan 23, 2020 · 3 comments
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event

Comments

@piloos
Copy link

piloos commented Jan 23, 2020

👻 Brief Description

When using mysql_service 'default' do ... action [:create, :start] ... end, the service mysql is stopped, disabled, enabled and started on every run even if no configuration changes are required.

🥞 Cookbook version

8.6.0

👩‍🍳 Chef-Infra Version

15.6.10

🎩 Platform details

Ubuntu 16.04

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a recipe with a mysql_service 'default' do ... end

🚓 Expected behavior

On subsequent Chef runs, I expect nothing to happen to the state of the mysql service.

➕ Additional context

Issue is probably caused by the fact that default will result in the service name mysql. The resource first tries to disable the system service, which is also called mysql and then enables his own service which is again called myqsl.
This statement is confirmed by the fact that selecting another service name does not cause the faulty behavior.

@p8
Copy link
Contributor

p8 commented Jan 30, 2020

Hmm, I had the same issue but didn't think it had anything to do with default service name.
stop_system_service should probably not be called when the service name is default.

action_class do
def stop_system_service
# service management resource
service 'mysql' do
service_name system_service_name
provider Chef::Provider::Service::Systemd
supports status: true
action [:stop, :disable]
end
end

@paul-krohn
Copy link

I can confirm I see this same behavior on: Chef 16.1.16-1, Ubuntu 18.04.3 LTS, cookbook version 8.7.2.

@ramereth ramereth added Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event labels Oct 3, 2020
@axl89
Copy link

axl89 commented Mar 21, 2021

I can also confirm this issue on Ubuntu 18.04.5 LTS and cookbook version 10.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event
Projects
None yet
Development

No branches or pull requests

5 participants