brint / wordpress-cookbook

Development repository for Opscode Cookbook wordpress
https://supermarket.chef.io/cookbooks/wordpress
Apache License 2.0
80 stars 174 forks source link

Database recipe causing error if run a second time #55

Open smallhadroncollider opened 9 years ago

smallhadroncollider commented 9 years ago

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)

wordpress::database line 56

smallhadroncollider commented 9 years ago

Running on Ubuntu 14.04. Only other Chef packages running are locale and apt.

joe4dev commented 9 years ago

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
axsuul commented 9 years ago

@joe4dev thanks that worked