fix logfile parameter handling.
authorTAKATSUKA Haruka <harukat@sraoss.co.jp>
Tue, 25 Dec 2012 08:28:36 +0000 (17:28 +0900)
committerTAKATSUKA Haruka <harukat@sraoss.co.jp>
Tue, 25 Dec 2012 08:28:36 +0000 (17:28 +0900)
fix logfile parameter handling. It was ignored in 2.0 script.
And fix indenting and meta-data descriptions.

ChangeLog
pgpool.in

index 5fd71a25b480b38a2aafb90f3d66bbcabf45bdd0..88684aa729965cfc3401b52a3bce1affd55ab849 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012/12/25
+       * fix logfile parameter
+       * fix pgpooluser parameter meta-data description
+       * put tabs and spaces in order
+
 2012/10/15 release 2.0
        * rewrite completely from the 1.x version script
        * allow monitoring method to chose one from 3 types; "pid", "pcp" and "psql"
index 7dd65425208b84a5fd57dd97c66e3c5faeaea902..059ffd604d0e3b2034cd1369dcfbc517d7a1060e 100644 (file)
--- a/pgpool.in
+++ b/pgpool.in
@@ -32,7 +32,8 @@
 #                   "/var/log/pgpool.log"
 #                   "| logger -t pgpool -p local3.info"
 #
-#    options      pgpool start options (except configuration file options)
+#    options      pgpool start options (except configuration file options).
+#                 "-D" is recommended if pgpool_status is not in shared space.
 #
 #    pgpooluser   pgpool start user
 #
@@ -114,13 +115,13 @@ fi
 if [ "x$OPTIONS" != 'x' ]; then
        PGPOOL_START_ARG="$PGPOOL_START_ARG $OPTIONS"
 fi
-if [ "x$LOGFILE" != 'x' ]; then
+if [ "x$OCF_RESKEY_logfile" != 'x' ]; then
        PGPOOL="nohup $PGPOOL"
-    if [ $(echo $LOGFILE | cut -c 1) = '|' ]; then
-        PGPOOL_START_ARG="$PGPOOL_START_ARG -n 2>&1 $LOGFILE &"
+       if [ $(echo $OCF_RESKEY_logfile | cut -c 1) = '|' ]; then
+               PGPOOL_START_ARG="$PGPOOL_START_ARG -n 2>&1 $OCF_RESKEY_logfile &"
        else
-        PGPOOL_START_ARG="$PGPOOL_START_ARG -n >>$LOGFILE 2>&1 &"
-    fi
+               PGPOOL_START_ARG="$PGPOOL_START_ARG -n >> $OCF_RESKEY_logfile 2>&1 &"
+       fi
 fi
 
 PGPOOL_STOP_ARG=" -m fast stop"
@@ -180,18 +181,18 @@ do_psql_check() {
 do_start() {
        if pidfile_process_exists_p 
        then 
-        ocf_log info "${OCF_RESOURCE_INSTANCE}: pgpool is already running."
+               ocf_log info "${OCF_RESOURCE_INSTANCE}: pgpool is already running."
                return $OCF_SUCCESS
        fi
 
        ocf_log info \
                "${OCF_RESOURCE_INSTANCE}: $PGPOOL $PGPOOL_START_ARG AS $OCF_RESKEY_pgpooluser"
-       ocf_run -q su $OCF_RESKEY_pgpooluser -c "$PGPOOL $PGPOOL_START_ARG"
-    if [ $? -ne 0 ]
+       su $OCF_RESKEY_pgpooluser -c "$PGPOOL $PGPOOL_START_ARG"
+       if [ $? -ne 0 ]
        then
                ocf_log err "${OCF_RESOURCE_INSTANCE}: Can't start pgpool."
-        return $OCF_ERR_GENERIC
-    fi
+               return $OCF_ERR_GENERIC
+       fi
 
        return $OCF_SUCCESS
 }
@@ -199,7 +200,7 @@ do_start() {
 do_stop() {
        if ! pidfile_process_exists_p
        then
-        ocf_log info "${OCF_RESOURCE_INSTANCE}: pgpool is already stopped."
+               ocf_log info "${OCF_RESOURCE_INSTANCE}: pgpool is already stopped."
                return $OCF_SUCCESS
        fi
 
@@ -207,8 +208,8 @@ do_stop() {
        if [ $? -ne 0 ]
        then
                ocf_log err "${OCF_RESOURCE_INSTANCE}: Can't stop pgpool."
-        return $OCF_ERR_GENERIC
-    fi
+               return $OCF_ERR_GENERIC
+       fi
 
        return $OCF_SUCCESS
 }
@@ -295,9 +296,9 @@ pgpool command line options (except configuration file options).
   </parameter>
   <parameter name="pgpooluser" unique="0" required="0">
    <longdesc lang="en">
-pgpool command line options (except configuration file options).
+pgpool run as this user.
    </longdesc>
-   <shortdesc lang="en">pgpool command line options</shortdesc>
+   <shortdesc lang="en">pgpool user</shortdesc>
    <content type="string" default="$OCF_RESKEY_pgpooluser_default" />
   </parameter>
   <parameter name="checkmethod" unique="0" required="0">