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

Fix #609 — Handle boilerplate db_type conf in sympa.pl --health_check #619

Merged
merged 2 commits into from
May 28, 2019
Merged
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
16 changes: 15 additions & 1 deletion src/sbin/sympa.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,24 @@ if ($main::options{'upgrade_config_location'}) {
$Conf::Conf{'etc'};
}

## Check if db_type is not the boilerplate one
if ($Conf::Conf{'db_type'} eq '(You must define this parameter)') {
die sprintf
ikedas marked this conversation as resolved.
Show resolved Hide resolved
"Database type \"%s\" defined in sympa.conf is the boilerplate one and obviously incorrect. Verify db_xxx parameters in sympa.conf\n",
$Conf::Conf{'db_type'};
}

## Preliminary check of db_type
unless ($Conf::Conf{'db_type'} and $Conf::Conf{'db_type'} =~ /\A\w+\z/) {
die sprintf
"Database type \"%s\" defined in sympa.conf seems incorrect. Verify db_xxx parameters in sympa.conf\n",
$Conf::Conf{'db_type'};
}

## Check database connectivity and probe database
unless (Sympa::DatabaseManager::probe_db()) {
die sprintf
"Database %s defined in sympa.conf has not the right structure or is unreachable. verify db_xxx parameters in sympa.conf\n",
"Database %s defined in sympa.conf has not the right structure or is unreachable. Verify db_xxx parameters in sympa.conf\n",
$Conf::Conf{'db_name'};
}

Expand Down