Details
Description
- Install MySQL server via mysql::server recipe
- Reboot node
- execute
service mysqld status
Actual result:
MySQL service not started
Expected result:
MySQL service should be up and running
***
We assume this is because "mysql" service has not been setup with ":enable" action (server.rb)
service "mysql" do
service_name node['mysql']['service_name']
if (platform?("ubuntu") && node.platform_version.to_f >= 10.04)
restart_command "restart mysql"
stop_command "stop mysql"
start_command "start mysql"
end
supports :status => true, :restart => true, :reload => true
action :nothing
end
We suggest to update code to something like that:
service "mysql" do
service_name node['mysql']['service_name']
if (platform?("ubuntu") && node.platform_version.to_f >= 10.04)
restart_command "restart mysql"
stop_command "stop mysql"
start_command "start mysql"
end
supports :status => true, :restart => true, :reload => true
action :enable
end
I've run into this problem in vagrant when using bridged networking. In my case, mysqld wouldn't restart because at the time it started, the interface for the ipaddress it was configured to listen on (the bridged interface) wasn't up. Solved the problem by setting node['mysql']['bind_address'] = "0.0.0.0".
However, I think the above proposal is still sound and should be incorporated into the next release of the cookbook.