mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Check for root before checking deps in install().
This commit is contained in:
12
bin/pt-agent
12
bin/pt-agent
@@ -8055,8 +8055,8 @@ sub install {
|
|||||||
|
|
||||||
my $stepno = 0;
|
my $stepno = 0;
|
||||||
my @steps = (
|
my @steps = (
|
||||||
"Check Perl module dependencies",
|
|
||||||
"Verify the user is root",
|
"Verify the user is root",
|
||||||
|
"Check Perl module dependencies",
|
||||||
"Connect to MySQL",
|
"Connect to MySQL",
|
||||||
"Verify the API key",
|
"Verify the API key",
|
||||||
"Create a MySQL user for the agent",
|
"Create a MySQL user for the agent",
|
||||||
@@ -8084,16 +8084,16 @@ sub install {
|
|||||||
# Pre-install checklist
|
# Pre-install checklist
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
|
|
||||||
# Check Perl module dependencies
|
# Must be root for --install.
|
||||||
$next_step->();
|
|
||||||
exit 1 if check_deps();
|
|
||||||
|
|
||||||
# 1. Must be root for --install.
|
|
||||||
$next_step->();
|
$next_step->();
|
||||||
if ( $EUID != 0 ) {
|
if ( $EUID != 0 ) {
|
||||||
die "You must run pt-agent --install as root.\n";
|
die "You must run pt-agent --install as root.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check Perl module dependencies
|
||||||
|
$next_step->();
|
||||||
|
exit 1 if check_deps();
|
||||||
|
|
||||||
# 2. Must be able to connect to MySQL to create pt_agent user.
|
# 2. Must be able to connect to MySQL to create pt_agent user.
|
||||||
$next_step->();
|
$next_step->();
|
||||||
eval {
|
eval {
|
||||||
|
Reference in New Issue
Block a user