wordpress-cookbook
wordpress-cookbook copied to clipboard
Database recipe causing error if run a second time
I'm using Chef with Vagrant. If I run vagrant reload --provision
having previously provisioned the machine I get an error:
ERROR: link[/var/run/mysqld/mysqld.sock] (wordpress::database line 56) had an error: Errno::ENOENT:
No such file or directory @ sys_fail2 - (/var/run/mysql-default/mysqld.sock, /var/run/mysqld/mysqld.sock)
Running on Ubuntu 14.04. Only other Chef packages running are locale
and apt
.
Same issue with Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)
The problems seems to be a non-existent target directory when trying to symlink mysqld.sock
(i.e., /var/run/mysqld
doesn't exist)
Temporary workaround: a) Explicitly create this directory before including the wordpress recipe:
directory '/var/run/mysqld' do
owner 'ubuntu'
group 'ubuntu'
mode '0755'
action :create
end
include_recipe 'wordpress::default'
b) Manually create this directory and the symlink:
sudo mkdir -p /var/run/mysqld && sudo ln -s /var/run/mysql-default/mysqld.sock /var/run/mysqld/mysqld.sock
@joe4dev thanks that worked