case 'PCP_START_PGPOOL':
$args = _setStartArgs();
$cmd = _PGPOOL2_COMMAND . $args;
- pr($cmd);
$ret = exec($cmd, $output, $return_var);
if ($return_var == 0) {
return array($pcpStatus[$return_var] => $output);
}
}
+ /*
+ * Confirm pgpool_version corresponds with pgpool_command's output in stderr
+ * like "pgpool-II version 3.5alpha1 (ekieboshi)"
+ */
+ $cmd = "{$params['pgpool_command']} --version 2>&1";
+ $ret = exec($cmd, $output, $return_var);
+ if ($return_var == 0) {
+ $output_arr = explode(" ", $output[0]);
+ if (strpos($output_arr[2], $params['version']) !== 0) {
+ $errors['version'] = $message['errWrongVersion'];
+ }
+ }
+
/*
* If no error, write conf/pgmgt.conf.php.
*/
- if (count($errors) == 0 ) {
+ if (count($errors) == 0) {
$pgmgtConfigFile = dirname(__FILE__) . '/conf/pgmgt.conf.php';
if (! is_writable($pgmgtConfigFile)) { errorPage('e5003'); }
'errShouldBeInteger' => 'This should be an integer',
'errShouldBeZeroOrMore' => 'This should be 0 or more',
'errSingleQuotation' => 'Please enclose the array element with a single quotation.',
+ 'errWrongVersion' => 'pgpool command shows another version',
'msgAddBackend' => 'Do you really add this node as a new backend?',
'msgAddBackendNg' => 'Invalid.',
'errShouldBeInteger' => '0以上の整数を入力してください',
'errShouldBeZeroOrMore' => '0以上である必要があります',
'errSingleQuotation' => '配列要素をシングルクォーテーションで囲んでください。',
+ 'errWrongVersion' => 'pgpool コマンドと一致していません。',
'msgAddBackend' => 'バックエンドノードとして追加してよろしいですか?',
'msgAddBackendNg' => 'バックエンドノード情報に不備があります。',
$rtn .= '</select>';
if ($errors[$param]) {
- $rtn .='<br>'. $errors[$param];
+ $rtn .= '<p class="check_error">'.
+ '<span class="error">Error</span> '. $errors[$param].
+ '</p>';
}
echo $rtn;
<tbody>
<tr>
<th><label>{$message.strLanguage|escape}</label> (string)</th>
- <td>{custom_select param='lang' echo=true}
- </td>
+ <td>{custom_select param='lang' echo=true}</td>
</tr>
<tr>
<th><label>{$message.strVersion|escape}</label> (float)</th>