summaryrefslogtreecommitdiff
path: root/status.php
diff options
context:
space:
mode:
authorUser yamaguti2008-02-04 09:31:22 +0000
committerUser yamaguti2008-02-04 09:31:22 +0000
commit67fa9c970006f2176ca5d35143de51b4256bb952 (patch)
treeff7144356dc66f7bc1afea0d2ab9d1efcf706f90 /status.php
parentb1735a61ba891abf477d4d240f64a3d35e8d1185 (diff)
allow a use of PIPE for a pgpool log in pgpoolAdmin
updated messages in lang/*, but my French is probably inaccurate.
Diffstat (limited to 'status.php')
-rw-r--r--status.php40
1 files changed, 12 insertions, 28 deletions
diff --git a/status.php b/status.php
index 0b1d6f2..e483561 100644
--- a/status.php
+++ b/status.php
@@ -66,14 +66,16 @@ switch ($action) {
if(isset($_POST['d'])) {
$args = $args . "-d ";
}
- if(isset($_POST['n'])) {
+ if(isset($_POST['n'])) {
$pgpoolLog = _PGPOOL2_LOG_FILE;
if($pgpoolLog == '') {
$logDir = readLogDir();
$pgpoolLog = "$logDir/pgpool.log";
}
-
- $args = "$args -n > $pgpoolLog ";
+ if(strpos($pgpoolLog, '|') !== FALSE)
+ $args = "$args -n 2>&1 $pgpoolLog ";
+ else
+ $args = "$args -n > $pgpoolLog ";
}
$ret = execPcp('PCP_START_PGPOOL', $args);
if(!array_key_exists('SUCCESS', $ret)) {
@@ -161,16 +163,17 @@ switch ($action) {
if(isset($_POST['d'])) {
$args = $args . "-d ";
}
- if(isset($_POST['n'])) {
+ if(isset($_POST['n'])) {
$pgpoolLog = _PGPOOL2_LOG_FILE;
if($pgpoolLog == '') {
$logDir = readLogDir();
$pgpoolLog = "$logDir/pgpool.log";
}
-
- $args = "$args -n > $pgpoolLog ";
- }
-
+ if(strpos($pgpoolLog, '|') !== FALSE)
+ $args = "$args -n 2>&1 $pgpoolLog ";
+ else
+ $args = "$args -n > $pgpoolLog ";
+ }
$ret = execPcp('PCP_START_PGPOOL', $args);
if(!array_key_exists('SUCCESS', $ret)) {
$tpl->assign('pgpoolStatus', 'pgpool restart failed.');
@@ -192,29 +195,10 @@ switch ($action) {
break;
case 'reload':
- $m = $_POST['m'];
-
-
/**
- * Start pgpool
+ * reload pgpool
*/
$args = ' ';
-
- if(isset($_POST['c'])) {
- $args = $args . "-c ";
- }
- if(isset($_POST['d'])) {
- $args = $args . "-d ";
- }
- if(isset($_POST['n'])) {
- $pgpoolLog = _PGPOOL2_LOG_FILE;
- if($pgpoolLog == '') {
- $logDir = readLogDir();
- $pgpoolLog = "$logDir/pgpool.log";
- }
-
- $args = "$args -n > $pgpoolLog ";
- }
$ret = execPcp('PCP_RELOAD_PGPOOL', $args);
break;