Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ashwinrayaprolu/1e26584ae3a1696b3ba20ca20f1924bd to your computer and use it in GitHub Desktop.
Save ashwinrayaprolu/1e26584ae3a1696b3ba20ca20f1924bd to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: myface
# Recipe:: database
#
# Copyright (C) 2012 YOUR_NAME
#
# All rights reserved - Do Not Redistribute
#
# Configure the MySQL client.
mysql_client 'default' do
action :create
end
# Configure the MySQL service.
mysql_service "#{node['myface']['database']['name']}" do
version '5.5'
bind_address '0.0.0.0'
port '3306'
initial_root_password "#{node['myface']['database']['password']}"
action [:create, :start]
end
#mysql2_chef_gem 'default' do
# action :install
#end
mysql2_chef_gem 'default' do
gem_version '0.3.17'
action :install
end
#/var/run/mysql-myface/mysqld.sock
# Externalize conection info in a ruby hash
mysql_connection_info = {
#:host => node['myface']['database']['host'],
:socket => "/var/run/mysql-#{node['myface']['database']['name']}/mysqld.sock",
:username => node['myface']['database']['username'],
:password => node['myface']['database']['password']
}
# Same create commands, connection info as an external hash
mysql_database node['myface']['database']['dbname'] do
connection mysql_connection_info
action :create
end
conftest.c: In function ‘t’:
conftest.c:13:57: error: ‘mysql_query’ undeclared (first use in this function)
int t(void) { void ((*volatile p)()); p = (void ((*)()))mysql_query; return 0; }
^
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))mysql_query; return 0; }
/* end */
"gcc -o conftest -I/opt/chef/embedded/include/ruby-2.1.0/x86_64-linux -I/opt/chef/embedded/include/ruby-2.1.0/ruby/backward -I/opt/chef/embedded/include/ruby-2.1.0 -I. -I/usr/local/include -I/opt/chef/embedded/include -O2 -O3 -g -pipe -I/opt/chef/embedded/include -I/opt/chef/embedded/include -O2 -O3 -g -pipe -fPIC conftest.c -L. -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L/usr/local/lib/mysql -Wl,-R/usr/local/lib/mysql -L. -Wl,-rpath,/opt/chef/embedded/lib -fstack-protector -L/opt/chef/embedded/lib -rdynamic -Wl,-export-dynamic -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -lnsl -lz -lm -Wl,-R -Wl,/opt/chef/embedded/lib -L/opt/chef/embedded/lib -lruby -lmysqlclient -lnsl -lz -lm -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
13: int t(void) { mysql_query(); return 0; }
/* end */
--------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment