Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Change db_initialized? function to check against database instead of files #720

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,6 @@ def db_init
mysql_install_db_cmd
end

def db_initialized?
if v80plus
::File.exist? "#{data_dir}/mysql.ibd"
else
::File.exist? "#{data_dir}/mysql/user.frm"
end
end

def mysql_install_db_bin
return "#{base_dir}/scripts/mysql_install_db" if platform_family?('omnios')
return "#{prefix_dir}/bin/mysql_install_db" if platform_family?('smartos')
Expand Down
2 changes: 1 addition & 1 deletion libraries/mysql_service_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def initialize_database
code init_records_script
umask '022'
returns [0, 1, 2] # facepalm
not_if { db_initialized? }
not_if { ::File.exist?("#{new_resource.pid_file}") }
action :run
end
end
Expand Down
Loading