Open piloos opened 4 years ago
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
.
https://github.com/sous-chefs/mysql/blob/d53a05ff2a76bab260e105fd4846d6d4191f4772/libraries/mysql_service_manager_systemd.rb#L120-L130
I can confirm I see this same behavior on: Chef 16.1.16-1, Ubuntu 18.04.3 LTS, cookbook version 8.7.2.
I can also confirm this issue on Ubuntu 18.04.5 LTS and cookbook version 10.1.1.
:ghost: Brief Description
When using
mysql_service 'default' do ... action [:create, :start] ... end
, the servicemysql
is stopped, disabled, enabled and started on every run even if no configuration changes are required.:pancakes: Cookbook version
8.6.0
:woman_cook: Chef-Infra Version
15.6.10
:tophat: Platform details
Ubuntu 16.04
Steps To Reproduce
Steps to reproduce the behavior:
mysql_service 'default' do ... end
:police_car: Expected behavior
On subsequent Chef runs, I expect nothing to happen to the state of the
mysql
service.:heavy_plus_sign: Additional context
Issue is probably caused by the fact that
default
will result in the service namemysql
. The resource first tries to disable the system service, which is also calledmysql
and then enables his own service which is again calledmyqsl
. This statement is confirmed by the fact that selecting another service name does not cause the faulty behavior.