I'm trying to install mysql recipe in vagrant. I use this cookbook for that.
MySql service starts after vagrant up
, but after reboot I can't perform neither vagrant provision
or vagrant up
, because the server fails to start.
I have realized, that Vagrant wipes /var/run
directory; it creates mysqld directory (for socket), but not mysql (for pid file). MySql can't find the directory and can't create pid file.
How can I make it work? Why Vagrant creates mysqld, but not mysql?
I also tried it with different boxes (precise32, cloud daily precise64).
Box: http://files.vagrantup.com/precise32.box Vagrantfile:
Vagrant.configure("2") do |config| config.vm.box = "precise32" config.omnibus.chef_version = :latest config.vm.box_url = "http://files.vagrantup.com/precise32.box" config.vm.network :forwarded_port, guest: 8000, host: 8080 config.vm.provider :virtualbox do |vb| vb.gui = true end config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "./chef-repo/cookbooks" chef.add_recipe "apt" chef.add_recipe "mysql::server" chef.json = { "mysql" => { "server_root_password" => "password", "server_repl_password" => "password", "server_debian_password" => "password" } } end end
/var/run
is a symbolic link to/run
which istmpfs
in-memory filesystem. It does NOT survive reboots. I don't think it has anything to do with vagrant. Simple reboot the VM, you lose everything in it. – Terry Wang