Skip to content

Commit

Permalink
Do not abort when failing to recover MySQL
Browse files Browse the repository at this point in the history
Fix #311
  • Loading branch information
atoomic committed Sep 7, 2023
1 parent b5086fe commit d6c9902
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
11 changes: 8 additions & 3 deletions elevate-cpanel
Original file line number Diff line number Diff line change
Expand Up @@ -3028,8 +3028,9 @@ EOS

use File::Copy ();

# use Log::Log4perl qw(:easy);
# use Log::Log4perl qw(:easy);
INIT { Log::Log4perl->import(qw{:easy}); }
use Elevate::Notify ();

# use Elevate::Components::Base();
our @ISA;
Expand Down Expand Up @@ -3138,9 +3139,13 @@ EOS
INFO("MySQL $mysql_version restored");
}
else {
FATAL("Failed to restore MySQL $mysql_version: upgrade $id status '$status'");
my $msg = "Failed to restore MySQL $mysql_version: upgrade $id status '$status'";

FATAL($msg);
FATAL("$out");
die 'Failed to restore MySQL';

Elevate::Notify::add_final_notification($msg);
return;
}
}
else {
Expand Down
13 changes: 9 additions & 4 deletions lib/Elevate/Components/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ Capture and reinstall MySQL packages.

use cPstrict;

use File::Copy ();
use Log::Log4perl qw(:easy);
use File::Copy ();
use Log::Log4perl qw(:easy);
use Elevate::Notify ();

use parent qw{Elevate::Components::Base};

Expand Down Expand Up @@ -130,9 +131,13 @@ sub _reinstall_mysql_packages {
INFO("MySQL $mysql_version restored");
}
else {
FATAL("Failed to restore MySQL $mysql_version: upgrade $id status '$status'");
my $msg = "Failed to restore MySQL $mysql_version: upgrade $id status '$status'";

FATAL($msg);
FATAL("$out");
die 'Failed to restore MySQL';

Elevate::Notify::add_final_notification($msg);
return;
}
}
else {
Expand Down

0 comments on commit d6c9902

Please sign in to comment.