From: Haruka harukat Date: Tue, 10 Mar 2009 17:26:29 +0000 (+0000) Subject: * add options parameter (for -d on/off at startup) X-Git-Tag: PGPOOL_HA_1_2~1 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=68ac3e7af94994fe20db3ddeb9dee6dc41bf7f50;p=pgpoolha.git * add options parameter (for -d on/off at startup) * fix stop with smart mode (use immediate first) * document minor fix --- diff --git a/ChangeLog b/ChangeLog index 19744f8..999f21f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2006/8/21 initial release + +2009/3/11 release 1.2 + * add "pidfile" parameter + * fix typo bugs + * renew sample cib.xml tested on heartbeat 2.1.4, pgpool-II 2.1 + * pipe expression was able to be used at "logfile" + * make pgpool.in always use "pgpool stop -m immediate" to (stop) + * add "options" parameter 2007/6/XX release 1.1 * fix ocf script to work properly with pgpool 3.2+ . @@ -17,7 +24,4 @@ "-d" option added automaticully. -2008/12/29 1.2-dev - * add "pidfile" parameter - * fix bugs - * renew sample cib.xml tested on heartbeat 2.1.4 +2006/8/21 initial release diff --git a/doc/pgpool-ha.en.txt b/doc/pgpool-ha.en.txt index 8a47789..ba10a61 100644 --- a/doc/pgpool-ha.en.txt +++ b/doc/pgpool-ha.en.txt @@ -67,22 +67,7 @@ heartbeat installation. - - - - - - - - - - - - - - - - + diff --git a/doc/pgpool-ha.ja.txt b/doc/pgpool-ha.ja.txt index 2e30dfc..e6023b9 100644 --- a/doc/pgpool-ha.ja.txt +++ b/doc/pgpool-ha.ja.txt @@ -96,14 +96,7 @@ cib.xmlはheartbeatでcrmを利用するために必要なファイルで、通 - - - - - - - - + diff --git a/src/Makefile.in b/src/Makefile.in index 35f6df2..17f2849 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -11,10 +11,10 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ all: pgpool.monitor pgpool -pgpool.monitor: +pgpool.monitor: pgpool.monitor.in sed -e 's#@_PSQL_@#${PSQL}#g' < pgpool.monitor.in | \ sed -e 's#@_PGPOOL_@#${PGPOOL}#g' > pgpool.monitor -pgpool: +pgpool: pgpool.in sed -e 's#@_PSQL_@#${PSQL}#g' < pgpool.in | \ sed -e 's#@_PGPOOL_@#${PGPOOL}#g' > pgpool diff --git a/src/pgpool.in b/src/pgpool.in index 1c27358..53caa22 100755 --- a/src/pgpool.in +++ b/src/pgpool.in @@ -4,7 +4,7 @@ # # Author: TANIDA Yutaka, TAKATSUKA Haruka # -# Copyright (c) 2006-2008 PgPool Global Development Group +# Copyright (c) 2006-2009 PgPool Global Development Group # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby @@ -17,9 +17,10 @@ # suitability of this software for any purpose. It is provided "as # is" without express or implied warranty. # -# defined OCF_RESKEY_value : pgpoolconf pcpconf hbaconf logfile pidfile +# defined OCF_RESKEY_value: +# pgpoolconf pcpconf hbaconf logfile pidfile options # -# default port number will be read from pgpool.conf automatically. +# default port number will be read from pgpool.conf automatically. check_pid () { @@ -54,6 +55,9 @@ if [ "x$OCF_RESKEY_hbaconf" = 'x' ]; then else HBA_CONF=$OCF_RESKEY_hbaconf fi +if [ "x$OCF_RESKEY_options" != 'x' ]; then + OPTIONS=$OCF_RESKEY_options +fi if [ "x$OCF_RESKEY_logfile" != 'x' ]; then LOGFILE=$OCF_RESKEY_logfile fi @@ -72,12 +76,15 @@ fi if [ "x$PCP_CONF" != 'x' ];then PGPOOL="$PGPOOL -F $PCP_CONF" fi +if [ "x$OPTIONS" != 'x' ]; then + PGPOOL_START_ARG="$PGPOOL_START_ARG $OPTIONS" +fi if [ "x$LOGFILE" != 'x' ];then PGPOOL="nohup $PGPOOL" if [ $(echo $LOGFILE | cut -c 1) = '|' ]; then - PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n 2>&1 $LOGFILE &" + PGPOOL_START_ARG="$PGPOOL_START_ARG -n 2>&1 $LOGFILE &" else - PGPOOL_START_ARG="$PGPOOL_START_ARG -d -n >>$LOGFILE 2>&1 &" + PGPOOL_START_ARG="$PGPOOL_START_ARG -n >>$LOGFILE 2>&1 &" fi fi @@ -87,16 +94,18 @@ PGPOOL_MONITOR=${PGPOOLCMD}.monitor PGPOOL_MONITOR_ARGS=--conf=$PGP_CONF localhost >/dev/null 2>&1 # Source function library. -. /etc/rc.d/init.d/functions +. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs +# . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) if check_pid then -# pgpool is already running. + ocf_log err "pgpool is already running." exit 0 else + ocf_log info "pgpoolRA: su -c \" $PGPOOL $PGPOOL_START_ARG \" postgres" su -c "$PGPOOL $PGPOOL_START_ARG" postgres exit $? fi @@ -104,20 +113,22 @@ case "$1" in stop) if check_pid then - RET=`su -c "$PGPOOL $PGPOOL_STOP_ARG | grep ERROR" postgres` - if [ -z "$RET" ] ; then - exit 0 - else +# RET=`su -c "$PGPOOL $PGPOOL_STOP_ARG | grep ERROR" postgres` +# ocf_log info "pgpoolRA: $RET" +# if [ -z "$RET" ] ; then +# exit 0 +# else # try immediate stop. RET=`su -c "$PGPOOL $PGPOOL_FORCE_STOP_ARG | grep ERROR " postgres` + ocf_log info "pgpoolRA: $RET" if [ -z "$RET" ] ; then exit 0; else - exit 1; + exit 7; fi - fi +# fi else -# not running + ocf_log info "pgpoolRA: request stop, but not running." exit 0 fi ;; @@ -191,11 +202,18 @@ cat < - Path to pgpool.pid logfile . + Path to pgpool.pid pidfile + + + additional options of pgpool-II start command. (e.g. -d) + + options + + @@ -212,7 +230,7 @@ EOF ;; *) echo "Usage: $0 {start|stop|status|methods|reload|recover|meta-data|monitor}" - exit 1 + exit 7 esac exit 0