From ea8a79b1c14447159dcaf869e0782f92c26f6bfe Mon Sep 17 00:00:00 2001 From: Tom Krouper Date: Wed, 11 Dec 2024 18:04:38 -0800 Subject: [PATCH] Check for pid_file --- libraries/helpers.rb | 8 -------- libraries/mysql_service_base.rb | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/libraries/helpers.rb b/libraries/helpers.rb index ad96fee6..46e93817 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -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') diff --git a/libraries/mysql_service_base.rb b/libraries/mysql_service_base.rb index 5e1fc8a5..87eab732 100644 --- a/libraries/mysql_service_base.rb +++ b/libraries/mysql_service_base.rb @@ -91,8 +91,7 @@ def initialize_database bash "#{new_resource.name} initial records" do 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