Skip to content

Commit

Permalink
added check using mysql_config to discover DB socket
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Aug 9, 2010
1 parent a9316c5 commit 5e65dec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions script/quick_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,18 @@ def create_initial_yml_files
end

print('Creating cms.yml...')
@db_socket = File.exists?('/var/lib/mysql/mysql.sock') ? '/var/lib/mysql/mysql.sock' : '/var/run/mysqld/mysqld.sock'
@db_socket = File.exists?(@db_socket) ? @db_socket : '/tmp/mysql.sock'

@db_socket = `mysql_config --socket`.to_s.strip

if @db_socket.blank?
@db_socket = File.exists?('/var/lib/mysql/mysql.sock') ? '/var/lib/mysql/mysql.sock' : '/var/run/mysqld/mysqld.sock'
@db_socket = File.exists?(@db_socket) ? @db_socket : '/tmp/mysql.sock'
end



if !File.exists?(@db_socket)

@db_socket = input_value("Mysql Socket","/var/lib/mysql/mysql.sock")
end
write_db_yml_file('cms.yml', { 'username' => "#{@db_name_short}_u" ,'password' => @user_password, 'database' => @db_name, 'host' => @db_host, 'port' => @db_port, 'socket' => @db_socket })
Expand Down

0 comments on commit 5e65dec

Please sign in to comment.