Check for root before checking deps in install().

This commit is contained in:
Daniel Nichter
2013-06-15 13:01:35 -07:00
parent e825b233f5
commit bfb01172be

View File

@@ -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 {