PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH
PGP_CONF=`@_PGPOOL_@ -h 2>&1 | grep default | sed -e 's/ config_file default path: //g'`
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+if [ "x$OCF_RESKEY_pgpoolconf" = 'x' ]; then
+ PGP_CONF=`@_PGPOOL_@ -h 2>&1 | grep " config_file default" | sed -e 's/ config_file default path: //g'`
+else
+ PGP_CONF=$OCF_RESKEY_pgpoolconf
+fi
+if [ "x$OCF_RESKEY_pcpconf" = 'x' ]; then
+ PCP_CONF=`@_PGPOOL_@ -h 2>&1 | grep " pcp_config_file default" | sed -e 's/ pcp_config_file default path: //g'`
+else
+ PCP_CONF=$OCF_RESKEY_pcpconf
+fi
+if [ "x$OCF_RESKEY_hbaconf" = 'x' ]; then
+ HBA_CONF=`@_PGPOOL_@ -h 2>&1 | grep " hba_file default" | sed -e 's/ hba_file default path: //g'`
+else
+ HBA_CONF=$OCF_RESKEY_hbaconf
+fi
+if [ "x$OCF_RESKEY_logfile" != 'x' ]; then
+ LOGFILE=$OCF_RESKEY_logfile
+fi
+
+echo $PGP_CONF
PGPOOL="@_PGPOOL_@ -f $PGP_CONF"
PGPOOL_START_ARG=""
+
+if [ "x$HBA_CONF" != 'x' ];then
+ PGPOOL="$PGPOOL -a $HBA_CONF"
+fi
+
+if [ "x$PCP_CONF" != 'x' ];then
+ PGPOOL="$PGPOOL -F $PCP_CONF"
+fi
+
+if [ "x$LOGFILE" != 'x' ];then
+ PGPOOL="nohup $PGPOOL"
+ PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n >>$LOGFILE 2>&1 &"
+fi
+
PGPOOL_STOP_ARG=" stop"
PGPOOL_FORCE_STOP_ARG=" -m i $PGPOOL_STOP_ARG"
PGPOOL_MONITOR=@_PGPOOL_@.monitor
PGPOOL_MONITOR_ARGS=--conf=$PGP_CONF localhost >/dev/null 2>&1
-PGPOOL_PID=`grep logdir $PGP_CONF | tr -d "''=" | awk '{print $2."/pgpool.pid"}'`
+PGPOOL_PID=`grep -P '^[^#]*logdir' $PGP_CONF | tr -d "''=" | awk '{print $2."/pgpool.pid"}'`
# Source function library.
. /etc/rc.d/init.d/functions
</longdesc>
<shortdesc lang="en">pgpool server control.</shortdesc>
<parameters>
+ <parameter name="pgpoolconf" unique="0" required="0">
+ <longdesc lang="en">
+ Path to pgpool.conf
+ </longdesc>
+ <shortdesc lang="en">pgpool.conf path</shortdesc>
+ <content type="string" default="$PGP_CONF" />
+ </parameter>
+ <parameter name="pcpconf" unique="0" required="0">
+ <longdesc lang="en">
+ Path to pcp.conf. pgpool-II only.
+ </longdesc>
+ <shortdesc lang="en">pcp.conf</shortdesc>
+ <content type="string" default="$PCP_CONF" />
+ </parameter>
+ <parameter name="hbaconf" unique="0" required="0">
+ <longdesc lang="en">
+ Path to pool_hba.conf. requires pgpool > 3.2 only.
+ </longdesc>
+ <shortdesc lang="en">pool_hba.conf</shortdesc>
+ <content type="string" default="$HBA_CONF" />
+ </parameter>
+
+ <parameter name="logfile" unique="0" required="0">
+ <longdesc lang="en">
+ Path to output logfile . logfile contains debuglog. if this entry is empty , log output is depends on pgpool.
+ </longdesc>
+ <shortdesc lang="en">logfile</shortdesc>
+ <content type="string" default="" />
+ </parameter>
</parameters>
<actions>
<action name="start" timeout="20" />
exit 1
esac
-exit 0
+
+lexit 0