the script was rewritten completely from 1.x version.
authorTAKATSUKA Haruka <harukat@sraoss.co.jp>
Mon, 15 Oct 2012 05:32:00 +0000 (14:32 +0900)
committerHaruka Takatsuka <harukat@srapc2499.sra.co.jp>
Mon, 15 Oct 2012 05:32:00 +0000 (14:32 +0900)
It got possible to choose a monitor method among three types;
"pid", "pcp" and "psql".  Use of Perl was abolished.

14 files changed:
Makefile.in [new file with mode: 0644]
README.ja [deleted file]
config.log [deleted file]
configure [deleted file]
configure.in [deleted file]
configure.sh [new file with mode: 0755]
doc/pgpool-ha.en.txt [deleted file]
doc/pgpool-ha.ja.txt [deleted file]
install-sh [deleted file]
pgpool.in [new file with mode: 0644]
src/Makefile.in [deleted file]
src/pgpool.in [deleted file]
src/pgpool.monitor.in [deleted file]
test.sh [new file with mode: 0755]

diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..e46f666
--- /dev/null
@@ -0,0 +1,26 @@
+
+TARGET = pgpool
+SRCS = pgpool.in
+PGSQL_DIR=@PGSQL_DIR@
+PGPOOL_DIR=@PGPOOL_DIR@
+OCF_DIR=@OCF_DIR@
+INSTALL=@INSTALL@ -c -m 755
+INSTALL_PROGRAM=${INSTALL}
+
+all: pgpool
+
+pgpool: pgpool.in Makefile
+       sed -e 's#@_PGSQL_DIR_@#${PGSQL_DIR}#g' < pgpool.in | \
+       sed -e 's#@_PGPOOL_DIR_@#${PGPOOL_DIR}#g' | \
+       sed -e 's#@_OCF_DIR_@#${OCF_DIR}#g' > pgpool
+
+install: all
+       $(INSTALL_PROGRAM) pgpool ${OCF_DIR}
+
+clean:
+       rm -f pgpool
+
+distclean:
+       rm -f pgpool
+       rm -f Makefile
+
diff --git a/README.ja b/README.ja
deleted file mode 100644 (file)
index 3e61eb8..0000000
--- a/README.ja
+++ /dev/null
@@ -1,3 +0,0 @@
-pgpool-ha - heartbeat scripts for pgpool
-
-日本語ドキュメントはdoc/pgpool-ha.ja.txtをご覧ください。
diff --git a/config.log b/config.log
deleted file mode 100644 (file)
index a8ee4ea..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by FULL-PACKAGE-NAME configure VERSION, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  $ ./configure 
-
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = fc1
-uname -m = i686
-uname -r = 2.6.15-1.2054_FC5
-uname -s = Linux
-uname -v = #1 Tue Mar 14 15:48:33 EST 2006
-
-/usr/bin/uname -p = unknown
-/bin/uname -X     = unknown
-
-/bin/arch              = i686
-/usr/bin/arch -k       = unknown
-/usr/convex/getsysinfo = unknown
-hostinfo               = unknown
-/bin/machine           = unknown
-/usr/bin/oslevel       = unknown
-/bin/universe          = unknown
-
-PATH: /usr/kerberos/sbin
-PATH: /usr/kerberos/bin
-PATH: /usr/local/sbin
-PATH: /usr/local/bin
-PATH: /sbin
-PATH: /bin
-PATH: /usr/sbin
-PATH: /usr/bin
-PATH: /opt/powergres/bin
-PATH: /root/bin
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-configure:1271: checking for a BSD-compatible install
-configure:1326: result: /usr/bin/install -c
-configure:1339: checking for /usr/lib/ocf/resource.d/heartbeat
-configure:1354: result: yes
-configure:1367: checking for psql
-configure:1385: found /opt/powergres/bin/psql
-configure:1400: result: /opt/powergres/bin/psql
-configure:1409: checking for pgpool
-configure:1427: found /opt/powergres/bin/pgpool
-configure:1442: result: /opt/powergres/bin/pgpool
-configure:1578: creating ./config.status
-
-## ---------------------- ##
-## Running config.status. ##
-## ---------------------- ##
-
-This file was extended by FULL-PACKAGE-NAME config.status VERSION, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  CONFIG_FILES    = 
-  CONFIG_HEADERS  = 
-  CONFIG_LINKS    = 
-  CONFIG_COMMANDS = 
-  $ ./config.status 
-
-on fc1
-
-config.status:634: creating src/Makefile
-
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-
-ac_cv_env_build_alias_set=
-ac_cv_env_build_alias_value=
-ac_cv_env_host_alias_set=
-ac_cv_env_host_alias_value=
-ac_cv_env_target_alias_set=
-ac_cv_env_target_alias_value=
-ac_cv_file__usr_lib_ocf_resource_d_heartbeat=yes
-ac_cv_path_PGPOOL=/opt/powergres/bin/pgpool
-ac_cv_path_PSQL=/opt/powergres/bin/psql
-ac_cv_path_install='/usr/bin/install -c'
-
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-
-DEFS='-DPACKAGE_NAME=\"FULL-PACKAGE-NAME\" -DPACKAGE_TARNAME=\"full-package-name\" -DPACKAGE_VERSION=\"VERSION\" -DPACKAGE_STRING=\"FULL-PACKAGE-NAME\ VERSION\" -DPACKAGE_BUGREPORT=\"BUG-REPORT-ADDRESS\" '
-ECHO_C=''
-ECHO_N='-n'
-ECHO_T=''
-INSTALL_DATA='${INSTALL} -m 644'
-INSTALL_PROGRAM='${INSTALL}'
-INSTALL_SCRIPT='${INSTALL}'
-LIBOBJS=''
-LIBS=''
-LTLIBOBJS=''
-PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
-PACKAGE_NAME='FULL-PACKAGE-NAME'
-PACKAGE_STRING='FULL-PACKAGE-NAME VERSION'
-PACKAGE_TARNAME='full-package-name'
-PACKAGE_VERSION='VERSION'
-PATH_SEPARATOR=':'
-PGPOOL='/opt/powergres/bin/pgpool'
-PSQL='/opt/powergres/bin/psql'
-SHELL='/bin/sh'
-bindir='${exec_prefix}/bin'
-build_alias=''
-datadir='${prefix}/share'
-exec_prefix='${prefix}'
-host_alias=''
-includedir='${prefix}/include'
-infodir='${prefix}/info'
-libdir='${exec_prefix}/lib'
-libexecdir='${exec_prefix}/libexec'
-localstatedir='${prefix}/var'
-mandir='${prefix}/man'
-oldincludedir='/usr/include'
-prefix='/usr/local'
-program_transform_name='s,x,x,'
-sbindir='${exec_prefix}/sbin'
-sharedstatedir='${prefix}/com'
-sysconfdir='${prefix}/etc'
-target_alias=''
-
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-
-#define PACKAGE_BUGREPORT "BUG-REPORT-ADDRESS"
-#define PACKAGE_NAME "FULL-PACKAGE-NAME"
-#define PACKAGE_STRING "FULL-PACKAGE-NAME VERSION"
-#define PACKAGE_TARNAME "full-package-name"
-#define PACKAGE_VERSION "VERSION"
-
-configure: exit 0
diff --git a/configure b/configure
deleted file mode 100755 (executable)
index 1bde7dc..0000000
--- a/configure
+++ /dev/null
@@ -1,2361 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for FULL-PACKAGE-NAME VERSION.
-#
-# Report bugs to <BUG-REPORT-ADDRESS>.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME='FULL-PACKAGE-NAME'
-PACKAGE_TARNAME='full-package-name'
-PACKAGE_VERSION='VERSION'
-PACKAGE_STRING='FULL-PACKAGE-NAME VERSION'
-PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PSQL PGPOOL LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_option in
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-             localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$0" : 'X\(//\)[^/]' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures FULL-PACKAGE-NAME VERSION to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
-  cat <<_ACEOF
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                         [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                         [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
-_ACEOF
-
-  cat <<\_ACEOF
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-  case $ac_init_help in
-     short | recursive ) echo "Configuration of FULL-PACKAGE-NAME VERSION:";;
-   esac
-  cat <<\_ACEOF
-
-Report bugs to <BUG-REPORT-ADDRESS>.
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
-    ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-          test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
-  cat <<\_ACEOF
-FULL-PACKAGE-NAME configure VERSION
-generated by GNU Autoconf 2.59
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by FULL-PACKAGE-NAME $as_me VERSION, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
-    2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-       ac_must_keep_next=false # Got value, back to normal.
-      else
-       case $ac_arg in
-         *=* | --config-cache | -C | -disable-* | --disable-* \
-         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-         | -with-* | --with-* | -without-* | --without-* | --x)
-           case "$ac_configure_args0 " in
-             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-           esac
-           ;;
-         -* ) ac_must_keep_next=true ;;
-       esac
-      fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
-      ;;
-    esac
-  done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-{
-  (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      sed -n \
-       "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
-    *)
-      sed -n \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-}
-    echo
-
-    cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
-      echo
-      for ac_var in $ac_subst_files
-      do
-       eval ac_val=$`echo $ac_var`
-       echo "$ac_var='"'"'$ac_val'"'"'"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
-      echo
-      sed "/^$/d" confdefs.h | sort
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-     ' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
-    esac
-  fi
-else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-       { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-       { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-       { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-       ac_cache_corrupted=:
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f $ac_dir/shtool; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-         if test $ac_prog = install &&
-           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         elif test $ac_prog = install &&
-           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
-           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-           break 3
-         fi
-       fi
-      done
-    done
-    ;;
-esac
-done
-
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL=$ac_install_sh
-  fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-# Checks for programs.
-echo "$as_me:$LINENO: checking for /usr/lib/ocf/resource.d/heartbeat" >&5
-echo $ECHO_N "checking for /usr/lib/ocf/resource.d/heartbeat... $ECHO_C" >&6
-if test "${ac_cv_file__usr_lib_ocf_resource_d_heartbeat+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  test "$cross_compiling" = yes &&
-  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
-echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-if test -r "/usr/lib/ocf/resource.d/heartbeat"; then
-  ac_cv_file__usr_lib_ocf_resource_d_heartbeat=yes
-else
-  ac_cv_file__usr_lib_ocf_resource_d_heartbeat=no
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_file__usr_lib_ocf_resource_d_heartbeat" >&5
-echo "${ECHO_T}$ac_cv_file__usr_lib_ocf_resource_d_heartbeat" >&6
-if test $ac_cv_file__usr_lib_ocf_resource_d_heartbeat = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: Can't determine where to install OCF script. Maybe Heartbeat doesn't installed" >&5
-echo "$as_me: error: Can't determine where to install OCF script. Maybe Heartbeat doesn't installed" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-# Extract the first word of "psql", so it can be a program name with args.
-set dummy psql; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PSQL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PSQL in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PSQL="$PSQL" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PSQL="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_PSQL" && ac_cv_path_PSQL="{ { echo "$as_me:$LINENO: error: psql not found." >&5
-echo "$as_me: error: psql not found." >&2;}
-   { (exit 1); exit 1; }; }"
-  ;;
-esac
-fi
-PSQL=$ac_cv_path_PSQL
-
-if test -n "$PSQL"; then
-  echo "$as_me:$LINENO: result: $PSQL" >&5
-echo "${ECHO_T}$PSQL" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "pgpool", so it can be a program name with args.
-set dummy pgpool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PGPOOL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PGPOOL in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PGPOOL="$PGPOOL" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PGPOOL="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_PGPOOL" && ac_cv_path_PGPOOL="{ { echo "$as_me:$LINENO: error: pgpool needed." >&5
-echo "$as_me: error: pgpool needed." >&2;}
-   { (exit 1); exit 1; }; }"
-  ;;
-esac
-fi
-PGPOOL=$ac_cv_path_PGPOOL
-
-if test -n "$PGPOOL"; then
-  echo "$as_me:$LINENO: result: $PGPOOL" >&5
-echo "${ECHO_T}$PGPOOL" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-
-          ac_config_files="$ac_config_files src/Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
-  (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
-      sed -n \
-       "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} |
-  sed '
-     t clear
-     : clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[         ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[    ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[      ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\),-D\1=\2,g
-t quote
-s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[     `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
-  fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by FULL-PACKAGE-NAME $as_me VERSION, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-                  instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-FULL-PACKAGE-NAME config.status VERSION
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  -*)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
-    ac_need_defaults=false;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1" ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@PSQL@,$PSQL,;t t
-s,@PGPOOL@,$PGPOOL,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-       cat >$tmp/stdin
-       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_file" : 'X\(//\)[^/]' \| \
-        X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
-  esac
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                    sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-        # Absolute (can't be DOS-style, as IFS=:)
-        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        echo "$f";;
-      *) # Relative
-        if test -f "$f"; then
-          # Build tree
-          echo "$f"
-        elif test -f "$srcdir/$f"; then
-          # Source tree
-          echo "$srcdir/$f"
-        else
-          # /dev/null tree
-          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/configure.in b/configure.in
deleted file mode 100644 (file)
index c35168d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.59)
-AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
-
-AC_PROG_INSTALL
-
-# Checks for programs.
-AC_CHECK_FILE(/usr/lib/ocf/resource.d/heartbeat,[],[AC_MSG_ERROR([Can't determine where to install OCF script. Maybe Heartbeat doesn't installed])])
-
-AC_PATH_PROG(PSQL,psql,[AC_MSG_ERROR([psql not found.])])
-AC_PATH_PROG(PGPOOL,pgpool,[AC_MSG_ERROR([pgpool needed.])])
-
-AC_CONFIG_FILES([src/Makefile])
-AC_OUTPUT
diff --git a/configure.sh b/configure.sh
new file mode 100755 (executable)
index 0000000..d387b95
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+PARAMS0=$*
+PARAMS=${PARAMS0//=/ }
+set -- $PARAMS
+
+WITH_PGSQL=
+WITH_PGPOOL=
+WITH_OCF=
+
+while true; do
+  case "$1" in
+   --help ) echo "options:"
+       echo " --with-pgsql  PostgreSQL install path"
+       echo " --with-pgpool pgpool install path"
+       echo " --with-ocf    OCF RA files path"
+       exit ;;
+   --with-pgsql )  WITH_PGSQL_DIR=$2  ; shift 2 ;;
+   --with-pgpool ) WITH_PGPOOL_DIR=$2 ; shift 2 ;;
+   --with-ocf    ) WITH_OCF_DIR=$2    ; shift 2 ;;
+   -- ) shift; break ;;
+   "" ) shift; break ;;
+   * ) echo "invalid parameter: $1" ; exit ;;
+  esac
+done
+
+if [ "x${WITH_PGSQL_DIR}" = "x" ]; then
+       WITH_PGSQL_DIR=/usr/local/pgsql
+fi
+if [ "x${WITH_PGPOOL_DIR}" = "x" ]; then
+       WITH_PGPOOL_DIR=/usr/local
+fi
+if [ "x${WITH_OCF_DIR}" = "x" ]; then
+       WITH_OCF_DIR=/usr/lib/ocf/resource.d/heartbeat
+fi
+INSTALL=`type -p install`
+
+if [ ! -d $WITH_PGSQL_DIR ]; then
+       echo "PostgreSQL directory ($WITH_PGSQL_DIR) not found."
+       # (warning only)
+fi
+if [ ! -f $WITH_PGPOOL_DIR/bin/pgpool ]; then
+       echo "Pgpool directory ($WITH_PGPOOL_DIR) not found."
+       # (warning only)
+fi
+if [ ! -d $WITH_OCF_DIR ]; then
+       echo "OCF RA directory ($WITH_OCF_DIR) not found."
+       exit 1
+fi
+if [ "x$INSTALL" = "x" ]; then
+       echo "no install command."
+       exit 1
+fi
+
+echo "PGSQL_DIR: $WITH_PGSQL_DIR"
+echo "PGPOOL_DIR: $WITH_PGPOOL_DIR"
+echo "OCF_DIR: $WITH_OCF_DIR"
+
+sed -e "s#@PGSQL_DIR@#${WITH_PGSQL_DIR}#g" < Makefile.in | \
+       sed -e "s#@PGPOOL_DIR@#${WITH_PGPOOL_DIR}#g" | \
+       sed -e "s#@OCF_DIR@#${WITH_OCF_DIR}#g" | \
+       sed -e "s#@INSTALL@#${INSTALL}#g" > Makefile
+
+echo "Makefile generated"
+echo $0 $PARAMS0 > config.log
+
diff --git a/doc/pgpool-ha.en.txt b/doc/pgpool-ha.en.txt
deleted file mode 100644 (file)
index 1c6320d..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-1. What's this?
-
-This program (pgpool-HA) is an agent script for pgpool and pgpool-II on
-the ha-cluster software Heartbeat 2.x.
-
-Pgpool is a replication server of PostgreSQL and makes reliability ,but pgpool
-is a single point failure . To avoid this , run pgpool over heartbeat. 
-
-This software contains:
-
--OCF style scripts for heartbeat, nesseary to run pgpool over heartbeat.
--A monitoring script for pgpool. 
-
-
-2. Requirement
-
-- heartbeat
- 2.0+ required.
-
-- pgpool
- Tested on pgpool-II only , but It will work if 'show pool_status' command
- was supported.
-
-- PostgreSQL client installation.
- 'psql' also required for install hosts . 'postmaster' doesn't required.
-
-- perl
- Need 5.0+ and GetOpt::Long.
-
-3. using
-
-After install this , pgpool can be used as heartbeat OCF-style 
-resources. See Heartbeat site.
-
-http://linux-ha.org/ConfiguringHeartbeat
-http://linux-ha.org/ClusterInformationBase/
-
-
--ha.cf 
-Set 'crm' to true , to use Cluster Resource Manager (CRM) to 
-monitor pgpool .
-
---
-crm true
---
-
-Other setting is depends on your configuration.
-
--cib.xml
-
-There's sample cib.xml file. 
-
-* Modify 'node1' and 'node2' to your hostname, '192.168.0.3' to your floating IP address . 
-* Put it to /var/lib/heartbeat/crm/ . Of cource this path is depends on your
-heartbeat installation.
-
------Sample cib.xml start
-
- <cib admin_epoch="0" epoch="0" num_updates="0">
-   <configuration>
-     <crm_config>
-       <cluster_property_set id="cib-bootstrap-options">
-         <attributes>
-           <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.4-fb84f606a422 tip"/>
-           <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="0"/>
-           <nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="100"/>
-           <nvpair name="last-lrm-refresh" id="cib-bootstrap-options-last-lrm-refresh" value="1227682013"/>
-           <nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop" value="false"/>
-         </attributes>
-       </cluster_property_set>
-     </crm_config>
-     <nodes></nodes>
-     <resources>
-       <primitive id="resource_ip" class="ocf" type="IPaddr" provider="heartbeat">
-         <meta_attributes id="resource_ip_meta_attrs">
-           <attributes>
-             <nvpair id="resource_ip_metaattr_target_role" name="target_role" value="started"/>
-           </attributes>
-         </meta_attributes>
-         <instance_attributes id="resource_ip_instance_attrs">
-           <attributes>
-             <nvpair id="0fc14517-1d8a-40d1-a1db-941cf14d9490" name="ip" value="192.168.0.3"/>
-             <nvpair id="7ef81de0-2fed-4fae-a517-ac0b96adba4e" name="cidr_netmask" value="23"/>
-             <nvpair id="754d986c-bb77-4028-98fa-5a222854001e" name="nic" value="eth0"/>
-           </attributes>
-         </instance_attributes>
-         <operations>
-           <op id="op_ip_start" name="start" timeout="90" start_delay="0" disabled="false" role="Started"/>
-           <op id="op_ip_stop" name="stop" timeout="100" start_delay="0" disabled="false" role="Started"/>
-           <op id="op_ip_mon" name="monitor" interval="5s" timeout="20s" start_delay="1s" disabled="false" role="Started"/>
-         </operations>
-       </primitive>
-       <primitive id="resource_pgpool2" class="ocf" type="pgpool" provider="heartbeat">
-         <meta_attributes id="resource_pgpool2_meta_attrs">
-           <attributes>
-             <nvpair id="resource_pgpool2_metaattr_target_role" name="target_role" value="started"/>
-           </attributes>
-         </meta_attributes>
-         <instance_attributes id="resource_pgpool2_instance_attrs">
-           <attributes>
-             <nvpair id="5adb33f4-6641-41a2-be3d-31264c579a67" name="pgpoolconf" value="/var/lib/pgsql/pool_ha/pgpool.conf"/>
-             <nvpair id="db163efd-0e00-41f1-9a4b-dfa3c5b299e0" name="pcpconf" value="/var/lib/pgsql/pool_ha/pcp.conf"/>
-             <nvpair id="9f69680a-ca9c-44b5-9644-d35e1b0286d4" name="hbaconf" value="/var/lib/pgsql/pool_ha/pool_hba.conf"/>
-             <nvpair id="1fabaefd-716d-4f6c-8827-0cd79e8505ae" name="logfile" value="/var/lib/pgsql/pool_ha/pgpool.log"/>
-             <nvpair id="ff4d7726-7bc1-4f3d-8d0e-8bc4aafafbf7" name="pidfile" value="/tmp/pgpool.pid"/>
-           </attributes>
-         </instance_attributes>
-         <operations>
-           <op id="op_pool_mon" name="monitor" interval="10" timeout="20" start_delay="1m"/>
-           <op id="op_pool_start" name="start" timeout="20"/>
-           <op id="op_pool_stop" name="stop" timeout="20"/>
-         </operations>
-       </primitive>
-     </resources>
-     <constraints>
-       <rsc_colocation id="colocation_poolip" from="resource_pgpool2" to="resource_ip" score="INFINITY"/>
-       <rsc_location id="ip_ping_const" rsc="resource_ip">
-         <rule id="prefered_ip_ping_const" score="-INFINITY" boolean_op="or">
-           <expression attribute="pingd" id="ip_ping_rule_ex1" operation="not_defined"/>
-           <expression attribute="pingd" id="13b33648-e266-4567-899d-d83ed66d3107" operation="lte" value="0" type="number"/>
-         </rule>
-       </rsc_location>
-       <rsc_location id="cli-prefer-resource_ip" rsc="resource_ip">
-         <rule id="prefered_cli-prefer-resource_ip" score="10">
-           <expression attribute="#uname" id="0742b4b3-d70c-4f11-945a-cfdea8cf5ff8" operation="eq" value="node1"/>
-         </rule>
-       </rsc_location>
-     </constraints>
-   </configuration>
- </cib>
-
------ Sample cib.xml end.
-
-
-- <instance_attributes> settings
-
-     key     |  description
- ------------+------------------------------------------------------------
- pgpoolconf  | path of pgpool.conf for pgpool start arguments
- hbaconf     | path of pool_hba.conf for pgpool start arguments
- pcpconf     | path of pcp.conf for pgpool start arguments (pgpool-II only)
- logfile     | log filename (or pipe expression e.g."|logger -p local0.info")
- pidfile     | path of the pid file of pgpool
- options     | other start arguments (e.g. "-d")
- pgpooluser  | user who run pgpool (default "postgres")
-
-
-
-- Active - Active configuration.
-
-Pgpool-ha 1.1+ supports multiple configuration , so it can support
-active-active style configuration . 
-
-
-4. Restriction
-
-* Pgpool-ha don't control PostgreSQL. You have to start/stop it manually.
-* In pgpool-ha, pgpool is monitored , but PostgreSQL is not . If your
-  pgpool becomes something wrong but can accept SQL , pgpool-ha can't handle.
-* If pgpool work but PostgreSQL is not avaliable , pgpool will failover.
-* Pgpool-II is monitored by psql. Monitoring with pcp command is not
-  supported yet. 
-
-5. Licences
-
-See ../COPYING file. 
-
diff --git a/doc/pgpool-ha.ja.txt b/doc/pgpool-ha.ja.txt
deleted file mode 100644 (file)
index 53c444b..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-1. これは何?
-
-このプログラム(pgpool-HA)は高可用性クラスタ構成ツール Hertbeat 2.x に対応した、
-pgpool、pgpool-II むけエージェントスクリプトです。
-
-Heartbeat 2.0以降にはCRM(Cluster Resource Manager)を使うことでサービス監視を
-含むリソース管理を行ってくれるため、容易に高可用性サービスを立ち上げることが
-可能になります。これとPostgreSQLのレプリケーションを実現するpgpoolを組み合わ
-せることで、PostgreSQLサービスの冗長化をより簡単に行うことができます。
-
-サービス図:
-
-                              +---------+   +----------+
-                             /|[pgpool] |---|PostgreSQL|
-+------+     +----------+   / +---------+   +----------+
-|client| --> |Virtual IP| --             \
-+------+     +----------+   \ +---------+ \ +----------+
-                             \|(pgpool) |  -|PostgreSQL|
-                              +---------+   +----------+
-
-
-本プログラムはHeartbeatと連携してpgpoolを高可用性対応するため、以下のコードが
-含まれています。
-
- - Heartbeat 2.0以降で利用できるOCF形式のpgpool管理スクリプト
- - 管理スクリプト内で使用する監視プログラム
-
-
-2. インストール
-
-このプログラムを利用するためには少なくとも2台のマシンと、それぞれに以下の
-ものがインストールされている必要があります。
-
-- PostgreSQL(http://www.postgresql.org/) のクライアント
-  psqlのみを必要とします。インストール時に環境変数PATHで参照可能な位置に
-  配置してください。
-
-- perl(http://www.perl.com/)
-  perl 5以上とGetOpt::Longを必要とします。
-
-- pgpool(http://pgpool.projects.postgresql.org/)
-  インストール時に環境変数PATHで参照可能な位置に配置してください。
-  設定ファイルについては指定しない場合インストール時のデフォルト位置になります。
-  本バージョンの動作テストは pgpool-II 2.2.6 で行っています。
-  show pool_status コマンドをサポートしている pgpool で動作するはずです。
-
-- heartbeat 2.0以降(http://www.linux-ha.org/)
-  本バージョンの動作テストは 2.1.4 で行っています。
-
-また、導入先のホストに入っている必要はありませんが、以下のソフトウェアも必要に
-なります。
-
-- PostgreSQL 
-  pgpoolが接続する先としてのPostgreSQLサーバーが必要になります。
-
-
-2.2 インストール手順
-
-基本的なプログラム、pgpool起動と監視スクリプトは以下の通りでインストール
-できます。pgpool,psqlを環境変数PATHで参照できる形にしておいてください。
-
-# ./configure
-# cd src
-# make
-# make install
-
-この時、OCF仕様のスクリプト"pgpool"が/usr/lib/orf/resource.d/heartbeat/以下に、
-監視スクリプトpgpool.monitorがpgpoolと同じディレクトリにコピーされます。
-
-
-2.3 heartbeatの設定
-
-heartbeat上でpgpoolを稼働させるためにはheartbeat側の設定が必要になります。
-
-- ha.cf
-  crmを利用します。以下の一行を設定してください。
-
-crm    true
-
-- cib.xml
-  cib.xml は heartbeat で crm を利用するために必要なファイルで、通常
-  /var/lib/heartbeat/crm/ 以下に配置されています。サンプルとして
-  1仮想IPアドレス、アクティブ/スタンバイのpgpool構成を行う cib.xml を
-  以下に示します。
-
- <cib admin_epoch="0" epoch="0" num_updates="0">
-   <configuration>
-     <crm_config>
-       <cluster_property_set id="cib-bootstrap-options">
-         <attributes>
-           <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.4-fb84f606a422 tip"/>
-           <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="0"/>
-           <nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="100"/>
-           <nvpair name="last-lrm-refresh" id="cib-bootstrap-options-last-lrm-refresh" value="1227682013"/>
-           <nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop" value="false"/>
-         </attributes>
-       </cluster_property_set>
-     </crm_config>
-     <nodes></node>
-       <node id="cc18cfc5-68d7-45f8-a9e3-5364456e0721" uname="node2" type="normal">
-         <instance_attributes id="nodes-cc18cfc5-68d7-45f8-a9e3-5364456e0721">
-           <attributes>
-             <nvpair id="standby-cc18cfc5-68d7-45f8-a9e3-5364456e0721" name="standby" value="off"/>
-           </attributes>
-         </instance_attributes>
-       </node>
-     </nodes>
-     <resources>
-       <primitive id="resource_ip" class="ocf" type="IPaddr" provider="heartbeat">
-         <meta_attributes id="resource_ip_meta_attrs">
-           <attributes>
-             <nvpair id="resource_ip_metaattr_target_role" name="target_role" value="started"/>
-           </attributes>
-         </meta_attributes>
-         <instance_attributes id="resource_ip_instance_attrs">
-           <attributes>
-             <nvpair id="0fc14517-1d8a-40d1-a1db-941cf14d9490" name="ip" value="192.168.0.3"/>
-             <nvpair id="7ef81de0-2fed-4fae-a517-ac0b96adba4e" name="cidr_netmask" value="23"/>
-             <nvpair id="754d986c-bb77-4028-98fa-5a222854001e" name="nic" value="eth0"/>
-           </attributes>
-         </instance_attributes>
-         <operations>
-           <op id="op_ip_start" name="start" timeout="90" start_delay="0" disabled="false" role="Started"/>
-           <op id="op_ip_stop" name="stop" timeout="100" start_delay="0" disabled="false" role="Started"/>
-           <op id="op_ip_mon" name="monitor" interval="5s" timeout="20s" start_delay="1s" disabled="false" role="Started"/>
-         </operations>
-       </primitive>
-       <primitive id="resource_pgpool2" class="ocf" type="pgpool" provider="heartbeat">
-         <meta_attributes id="resource_pgpool2_meta_attrs">
-           <attributes>
-             <nvpair id="resource_pgpool2_metaattr_target_role" name="target_role" value="started"/>
-           </attributes>
-         </meta_attributes>
-         <instance_attributes id="resource_pgpool2_instance_attrs">
-           <attributes>
-             <nvpair id="5adb33f4-6641-41a2-be3d-31264c579a67" name="pgpoolconf" value="/var/lib/pgsql/pool_ha/pgpool.conf"/>
-             <nvpair id="db163efd-0e00-41f1-9a4b-dfa3c5b299e0" name="pcpconf" value="/var/lib/pgsql/pool_ha/pcp.conf"/>
-             <nvpair id="9f69680a-ca9c-44b5-9644-d35e1b0286d4" name="hbaconf" value="/var/lib/pgsql/pool_ha/pool_hba.conf"/>
-             <nvpair id="1fabaefd-716d-4f6c-8827-0cd79e8505ae" name="logfile" value="/var/lib/pgsql/pool_ha/pgpool.log"/>
-             <nvpair id="ff4d7726-7bc1-4f3d-8d0e-8bc4aafafbf7" name="pidfile" value="/tmp/pgpool.pid"/>
-           </attributes>
-         </instance_attributes>
-         <operations>
-           <op id="op_pool_mon" name="monitor" interval="10" timeout="20" start_delay="1m"/>
-           <op id="op_pool_start" name="start" timeout="20"/>
-           <op id="op_pool_stop" name="stop" timeout="20"/>
-         </operations>
-       </primitive>
-     </resources>
-     <constraints>
-       <rsc_colocation id="colocation_poolip" from="resource_pgpool2" to="resource_ip" score="INFINITY"/>
-       <rsc_location id="ip_ping_const" rsc="resource_ip">
-         <rule id="prefered_ip_ping_const" score="-INFINITY" boolean_op="or">
-           <expression attribute="pingd" id="ip_ping_rule_ex1" operation="not_defined"/>
-           <expression attribute="pingd" id="13b33648-e266-4567-899d-d83ed66d3107" operation="lte" value="0" type="number"/>
-         </rule>
-       </rsc_location>
-       <rsc_location id="cli-prefer-resource_ip" rsc="resource_ip">
-         <rule id="prefered_cli-prefer-resource_ip" score="10">
-           <expression attribute="#uname" id="0742b4b3-d70c-4f11-945a-cfdea8cf5ff8" operation="eq" value="node1"/>
-         </rule>
-       </rsc_location>
-     </constraints>
-   </configuration>
- </cib>
-
-
-  この設定ファイル例によりpgpoolを管理できるようになります。
-  この中で書き換える項目は以下の通りになります。
-
-- ノード名
- サンプル中 node1、node2 と示されているのがノード名になります。ここでは
-  ha.cf で指定してあるのと同じ名称を指定してください。
-
-- IPアドレス
- サンプル中で 192.168.0.3 と示されているのが仮想IPアドレスです。
-  ここに指定することでpgpoolが稼働中のホストに当該IPアドレスが割り振られます。
-
-- 設定ファイル格納場所、その他オプション
-  instance_attributes項目に以下の設定キーと値を指定することができます。
-
- 設定キー    |      説明
- ------------+----------------------------------------------------------
- pgpoolconf  | pgpool起動引数に指定する pgpool.conf のパス
- hbaconf     | pgpool起動引数に指定する pool_hba.conf のパス
- pcpconf     | pgpool起動引数に指定する pcp.conf のパス (pgpool-IIのみ)
- logfile     | pgpoolからリダイレクト出力するログファイル
- pidfile     | pgpoolのpidが記述されるファイルを指定
- options     | その他 pgpool の起動オプション "-d" など
- pgpooluser  | pgpoolを起動するユーザを指定、デフォルトは postgres
-
- この記述が終了したらファイルを heartbeat が利用する全てのサーバーに配置します。 cib.xml はサーバー間で全く同じである必要があります。なお、記述の検証には
- heartbeat に付属している crm_verify コマンドが使えます。
-
- crm_verify -X /var/lib/heartbeat/crm/cib.xml
-
- 最後に全てが終わったら起動して確認します。
-
- # service heartbeat start
-
-そのあとheartbeat自体の起動が終了まで数分待ち、psコマンドにてpgpoolが
-起動していることを確認することができれば完了です。
-
-
-2.3 active-active 構成について
-
-pgpool-HA 1.1以降では、複数の設定ファイルが記述できるため、Active-Active構成
-(相互のActive-Standby)を組むことが可能になります。type が pgpool である
-リソースを複数記述します。それぞれ異なる設定ファイルに対応づけて、別ポートで
-動作させます。
-
-
-3. 利用方法
-
-本ソリューションの起動及び終了は heartbeat 経由で自動で行われます。
-順序としては以下の通りになります。
-
-- PostgreSQLを起動
-
-pgpoolで利用するPostgreSQLを起動します。
-
-- heartbeatを起動
-
-heartbeatを起動します。起動する場合はサービスとして
-
-#service heartbeat start
-
-と利用します。しばらくするとpgpoolが利用可能になります。この後、psql等で接続
-するには cib.xml で指定したIPアドレスとpgpoolで指定したポートを指定します。
-例えば先ほどのサンプルの場合
-
- psql -h 192.168.0.3 -p 9999
-
-と実行すれば接続できます。
-
-終了させる場合は、全く逆に全てのサーバーで heartbeat を終了させてください。
-heartbeat の終了のためには以下の通りのコマンドを実行します。
-
-# service heartbeat stop
-
-heartbeatを稼働した状態で pgpool だけ停止させる場合には、リソースを停止する
-heartbeatのコマンドを使用してください。
-
-4. FAQ
-
-- 接続できない
-  以下の項目を確認してください。
-
--- heartbeatが起動しているか。
-
-   起動していない場合、heartbeatのインストールか設定ファイルに問題があります。
-
--- heartbeatが起動していて、psの出力の中にcrmdが存在しているか
-
-   crmdが立ち上がってない、終了した場合にはcib.xmlファイルの内容にエラーがある
-   可能性があります。特に前回実行時の内容を署名していますので、.sigファイルが
-   当該ディレクトリに存在している場合にはエラーになります。そのため、書き換え
-   た場合には*.sigファイルを消去し、再度実行してみてください。
-
--- pgpoolが起動しているか。
-
-   起動していない場合、pgpoolが単独で実行できるかどうかを確認してください。
-   また、設定ファイルの内容も確認して下さい。
-
--- PostgreSQLが起動しているか。
-
-   起動していない場合は立ち上げてください。
-
--- 浮動IPに対してping等でアクセスできるか。
-
-   アクセスできない場合には設定ファイルを再度確認してください。
-
-
- なお、一度全てのホストでheartbeatを終了/起動させることで実行できることが
- あります。
-
-- PGClusterのロードバランサーの冗長化に使えるか?
-技術的には可能ですが、現在その設定に必要な内容が不足しているため、利用すること
-はできません。このためには以下の作業が必要です。
-
--- pgpoolファイルを書き換え、pglbを起動終了させるようにする
-
-
-5. 制限事項
-・本プログラムに置ける監視はpgpoolの稼働チェック(pidファイルとSQL発行)のみ
-  です。それ以外の異常状態(起動して、SQL文も受け付けるが異常が発生している
-  ような場合など)には対応できません。
-・PostgreSQL に対する管理は行っていません。
-・PostgreSQL が全く起動していない状態は異常であるとみなし、pgpoolリソース
- は障害状態であると判断します。
-・PostgreSQL がクラッシュした場合のリカバリは別途行う必要があります。
-  この方法についてはpgpoolに準じます。
-・pgpoolが複数インストールされている場合の挙動は、インストール時の $PATH に
-  依存して決定します。他の種類のバイナリは管理できません。
-  (実現するにはエージェントスクリプトを手修正して複数種類作ります)
-・pgpool-II監視はpsqlで行われます。pcpを利用した監視はまだサポートされていま
-  せん。
-
-6. 著作権
-本プログラムは谷田 豊盛(ゆたか) (tanida@sraoss.co.jp)がSRA OSS,Inc.日本支社
-の後援の元作成し、pgpool global development groupに寄贈されました。ライセンスは
-pgpoolに準じますが、詳細は付属のCOPYINGファイルを参照ください。
-
diff --git a/install-sh b/install-sh
deleted file mode 100755 (executable)
index 4d4a951..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2005-05-14.22
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-chmodcmd="$chmodprog 0755"
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test -n "$1"; do
-  case $1 in
-    -c) shift
-        continue;;
-
-    -d) dir_arg=true
-        shift
-        continue;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
-
-    -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
-
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
-
-    -t) dstarg=$2
-       shift
-       shift
-       continue;;
-
-    -T) no_target_directory=true
-       shift
-       continue;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    *)  # When -d is used, all remaining arguments are directories to create.
-       # When -t is used, the destination is already specified.
-       test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-       for arg
-       do
-          if test -n "$dstarg"; then
-           # $@ is not empty: it contains at least $arg.
-           set fnord "$@" "$dstarg"
-           shift # fnord
-         fi
-         shift # arg
-         dstarg=$arg
-       done
-       break;;
-  esac
-done
-
-if test -z "$1"; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call `install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-for src
-do
-  # Protect names starting with `-'.
-  case $src in
-    -*) src=./$src ;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
-  else
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dstarg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-
-    dst=$dstarg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst ;;
-    esac
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-       echo "$0: $dstarg: Is a directory" >&2
-       exit 1
-      fi
-      dst=$dst/`basename "$src"`
-    fi
-  fi
-
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-
-  # Make sure that the destination directory exists.
-
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-        '
-    IFS="${IFS-$defaultIFS}"
-
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
-
-    pathcomp=
-
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
-      shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-       # mkdir can fail with a `File exist' error in case several
-       # install-sh are creating the directory concurrently.  This
-       # is OK.
-       test -d "$pathcomp" || exit
-      fi
-      pathcomp=$pathcomp/
-    done
-  fi
-
-  if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
-  else
-    dstfile=`basename "$dst"`
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
-
-    # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-          # The rename failed, perhaps because mv can't rename something else
-          # to itself, or perhaps because mv is so ancient that it does not
-          # support -f.
-
-          # Now remove or move aside any old file at destination location.
-          # We try this two ways since rm can't unlink itself on some
-          # systems and the destination file might be busy for other
-          # reasons.  In this case, the final cleanup might fail but the new
-          # file should still install successfully.
-          {
-            if test -f "$dstdir/$dstfile"; then
-              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-              || {
-                echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-                (exit 1); exit 1
-              }
-            else
-              :
-            fi
-          } &&
-
-          # Now rename the file to the real destination.
-          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-        }
-    }
-  fi || { (exit 1); exit 1; }
-done
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/pgpool.in b/pgpool.in
new file mode 100644 (file)
index 0000000..7dd6542
--- /dev/null
+++ b/pgpool.in
@@ -0,0 +1,392 @@
+#!/bin/bash
+#
+# OCF Resource Agent for pgpool-II 2.0
+#
+# Copyright 2012           PgPool Global Development Group 
+#
+# Permission to use, copy, modify, and distribute this software and
+# its documentation for any purpose and without fee is hereby
+# granted, provided that the above copyright notice appear in all
+# copies and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of the
+# author not be used in advertising or publicity pertaining to
+# distribution of the software without specific, written prior
+# permission. The author makes no representations about the
+# suitability of this software for any purpose.  It is provided "as
+# is" without express or implied warranty.
+#
+# Support:                 pgpool-general@pgpool.net
+#
+# OCF parameters are as below
+#
+#    pgpoolconf   path of pgpool.conf
+#                 (default: @_PGPOOL_DIR_@/etc/pgpool.conf)
+#
+#    pcpconf      path of pcp.conf
+#
+#    hbaconf      path of pool_hba.conf
+#
+#    logfile      log file for stdout and stderr redirection;
+#                 or a program for log collecting by a pipeline.
+#                   (e.g.)
+#                   "/var/log/pgpool.log"
+#                   "| logger -t pgpool -p local3.info"
+#
+#    options      pgpool start options (except configuration file options)
+#
+#    pgpooluser   pgpool start user
+#
+#    checkmethod  monitoring method:
+#                   "pid"  process existence check only (default).
+#                   "pcp"  check by pcp_node_count command.
+#                   "psql" check by psql command.
+#
+#    checkstring  parameter for monitoring method
+#                   checkmetod="pid"  : pidfile
+#                      (default: parse from pgpool.conf file)
+#                   checkmetod="pcp"  : parameter string for pcp_node_count
+#                      (default: "10 localhost 9898 postgres pass")
+#                   checkmetod="psql" : parameter string for psql
+#                      (default: "-U postgres -h localhost -l -p 9999")
+#
+
+##### Source function library.
+
+: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
+. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs
+
+###### Parameter defaults
+
+OCF_RESKEY_pgpoolconf_default="@_PGPOOL_DIR_@/etc/pgpool.conf"
+OCF_RESKEY_pcpconf_default=""
+OCF_RESKEY_hbaconf_default=""
+OCF_RESKEY_logfile_default=""
+OCF_RESKEY_options_default=""
+OCF_RESKEY_pgpooluser_default="postgres"
+OCF_RESKEY_checkmethod_default="pid"
+OCF_RESKEY_checkstring_default=""
+
+: ${OCF_RESKEY_pgpoolconf=${OCF_RESKEY_pgpoolconf_default}}
+: ${OCF_RESKEY_pcpconf=${OCF_RESKEY_pcpconf_default}}
+: ${OCF_RESKEY_hbaconf=${OCF_RESKEY_hbaconf_default}}
+: ${OCF_RESKEY_logfile=${OCF_RESKEY_logfile_default}}
+: ${OCF_RESKEY_options=${OCF_RESKEY_options_default}}
+: ${OCF_RESKEY_pgpooluser=${OCF_RESKEY_pgpooluser_default}}
+: ${OCF_RESKEY_checkmethod=${OCF_RESKEY_checkmethod_default}}
+
+if [ ! -e $OCF_RESKEY_pgpoolconf ]; then
+       ocf_log warn "${OCF_RESOURCE_INSTANCE}: file '$OCF_RESKEY_pgpoolconf' (pgpoolconf) does not exists."
+fi
+
+PIDFILE=$(cat "$OCF_RESKEY_pgpoolconf" | grep "^pid_file_name" | cut -d "'" -f 2)
+
+if [ "x$OCF_RESKEY_checkstring" = "x" ] ; then
+       case "$OCF_RESKEY_checkmethod" in
+       pcp)
+               OCF_RESKEY_checkstring="10 localhost 9898 postgres pass" ;;
+       psql)
+               OCF_RESKEY_checkstring="-h localhost -U postgres -p 9999 -l" ;;
+       esac
+else
+       case "$OCF_RESKEY_checkmethod" in
+       pid)
+               PIDFILE=$OCF_RESKEY_checkstring ;;
+       esac
+fi
+
+###### Configured parameter
+
+PGPOOLCMD=@_PGPOOL_DIR_@/bin/pgpool
+PSQLCMD=@_PGSQL_DIR_@/bin/psql
+PCPNCCMD=@_PGPOOL_DIR_@/bin/pcp_node_count
+
+###### Build Start/Stop command
+
+PGPOOL="$PGPOOLCMD -f $OCF_RESKEY_pgpoolconf" 
+PGPOOL_START_ARG=""
+
+if [ "x$OCF_RESKEY_hbaconf" != 'x' ]; then
+       PGPOOL="$PGPOOL -a $OCF_RESKEY_hbaconf"
+fi
+if [ "x$OCF_RESKEY_pcpconf" != 'x' ]; then
+       PGPOOL="$PGPOOL -F $OCF_RESKEY_pcpconf"
+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 -n 2>&1 $LOGFILE &"
+       else
+        PGPOOL_START_ARG="$PGPOOL_START_ARG -n >>$LOGFILE 2>&1 &"
+    fi
+fi
+
+PGPOOL_STOP_ARG=" -m fast stop"
+
+###### Functions
+
+do_monitor() {
+       if ! pidfile_process_exists_p 
+       then
+               return $OCF_NOT_RUNNING
+       fi
+
+       case "$OCF_RESKEY_checkmethod" in
+       pid)
+               return $OCF_SUCCESS
+               ;;
+       pcp)
+               do_pcp_check
+               return $?
+               ;;
+       psql)
+               do_psql_check
+               return $?
+               ;;
+       esac
+       ocf_log err "${OCF_RESOURCE_INSTANCE}: Invalid checkmethod parameter"
+       return $OCF_ERR_GENERIC
+}
+
+
+do_pcp_check() {
+       ocf_run -q $PCPNCCMD $OCF_RESKEY_checkstring
+       rc=$?
+       if [ $rc -eq 0 ]
+       then
+               return $OCF_SUCCESS
+       else
+               ocf_log err "${OCF_RESOURCE_INSTANCE}: pcp_check fail"
+               return $OCF_NOT_RUNNING
+       fi
+}
+
+
+do_psql_check() {
+       ocf_run -q $PSQLCMD $OCF_RESKEY_checkstring
+       rc=$?
+       if [ $rc -eq 0 ]
+       then
+               return $OCF_SUCCESS
+       else
+               ocf_log err "${OCF_RESOURCE_INSTANCE}: psql_check fail"
+               return $OCF_NOT_RUNNING
+       fi
+}
+
+
+do_start() {
+       if pidfile_process_exists_p 
+       then 
+        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 ]
+       then
+               ocf_log err "${OCF_RESOURCE_INSTANCE}: Can't start pgpool."
+        return $OCF_ERR_GENERIC
+    fi
+
+       return $OCF_SUCCESS
+}
+
+do_stop() {
+       if ! pidfile_process_exists_p
+       then
+        ocf_log info "${OCF_RESOURCE_INSTANCE}: pgpool is already stopped."
+               return $OCF_SUCCESS
+       fi
+
+       su -c "$PGPOOL $PGPOOL_STOP_ARG"
+       if [ $? -ne 0 ]
+       then
+               ocf_log err "${OCF_RESOURCE_INSTANCE}: Can't stop pgpool."
+        return $OCF_ERR_GENERIC
+    fi
+
+       return $OCF_SUCCESS
+}
+
+do_reload() {
+       su -c "$PGPOOL reload"
+       return $OCF_SUCCESS
+}
+
+# has side effect: kills zombie immediately 
+# dependency: /proc/PID/status file
+#
+pidfile_process_exists_p() {
+       if [ -f $PIDFILE ]; then
+               RPID=`cat $PIDFILE`
+               if kill -0 $RPID
+               then
+                       if grep -E "^State:.*zombie" /proc/$RPID/status
+                       then
+                               pkill -QUIT -P $RPID
+                               kill -QUIT $RPID
+                               return 1
+                       else
+                               return 0
+                       fi
+               else
+                       return 1
+               fi
+       else
+               ocf_log debug "${OCF_RESOURCE_INSTANCE}: PIDFILE $PIDFILE doesn't exist"
+               return 1
+       fi
+}
+
+do_metadata() {
+       cat <<EOF
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="pgpool">
+ <version>2.0</version>
+ <longdesc lang="en">
+This is an OCF Resource Agent for pgpool-II.
+ </longdesc>
+ <shortdesc lang="en">OCF Resource Agent for pgpool-II</shortdesc>
+ <parameters>
+  <parameter name="pgpoolconf" unique="0" required="0">
+   <longdesc lang="en">
+Path to pgpool.conf of pgpool.
+   </longdesc>
+   <shortdesc lang="en">pgpool.conf path</shortdesc>
+   <content type="string" default="$OCF_RESKEY_pgpoolconf_default" />
+  </parameter>
+  <parameter name="pcpconf" unique="0" required="0">
+   <longdesc lang="en">
+Path to pcp.conf of pgpool.
+   </longdesc>
+   <shortdesc lang="en">pcp.conf path</shortdesc>
+   <content type="string" default="$OCF_RESKEY_pcpconf_default" />
+  </parameter>
+  <parameter name="hbaconf" unique="0" required="0">
+   <longdesc lang="en">
+Path to pool_hba.conf of pgpool.
+   </longdesc>
+   <shortdesc lang="en">pool_hba.conf path</shortdesc>
+   <content type="string" default="$OCF_RESKEY_hbaconf_default" />
+  </parameter>
+  <parameter name="logfile" unique="0" required="0">
+   <longdesc lang="en">
+pgpool log file for stdout and stderr redirection;
+or a program for log collecting by a pipeline.
+(e.g.)
+ "/var/log/pgpool.log"
+ "| logger -t pgpool -p local3.info"
+   </longdesc>
+   <shortdesc lang="en">pgpool logfile</shortdesc>
+   <content type="string" default="$OCF_RESKEY_logfile_default" />
+  </parameter>
+  <parameter name="options" unique="0" required="0">
+   <longdesc lang="en">
+pgpool command line options (except configuration file options).
+   </longdesc>
+   <shortdesc lang="en">pgpool command line options</shortdesc>
+   <content type="string" default="$OCF_RESKEY_options_default" />
+  </parameter>
+  <parameter name="pgpooluser" unique="0" required="0">
+   <longdesc lang="en">
+pgpool command line options (except configuration file options).
+   </longdesc>
+   <shortdesc lang="en">pgpool command line options</shortdesc>
+   <content type="string" default="$OCF_RESKEY_pgpooluser_default" />
+  </parameter>
+  <parameter name="checkmethod" unique="0" required="0">
+   <longdesc lang="en">
+monitoring method type.
+ "pid"  process existence check only.
+ "pcp"  check by pcp_node_count command.
+ "psql" check by psql command.
+   </longdesc>
+   <shortdesc lang="en">monitoring method type</shortdesc>
+   <content type="string" default="$OCF_RESKEY_checkmethod_default" />
+  </parameter>
+  <parameter name="checkstring" unique="0" required="0">
+   <longdesc lang="en">
+parameter for monitoring method.
+when checkmetod="pid", this means pidfile path.
+  (e.g.) "/var/run/pgpool/pgpool.pid"
+when checkmetod="pcp", this means a parameter string for pcp_node_count.
+  (e.g.) "10 localhost 9898 postgres pass"
+when checkmetod="psql", this means a parameter string for psql.
+  (e.g.) "-U postgres -h localhost -c 'SELECT 1' -p 9999"
+   </longdesc>
+   <shortdesc lang="en">a parameter for monitoring method</shortdesc>
+   <content type="string" default="$OCF_RESKEY_checkstring_default" />
+  </parameter>
+ </parameters>
+ <actions>
+  <action name="start" timeout="20" />
+  <action name="stop" timeout="20" />
+  <action name="monitor" depth="0" timeout="20" interval="10" />
+  <action name="reload" timeout="20" />
+  <action name="meta-data" timeout="5" />
+  <action name="validate-all" timeout="5" />
+ </actions>
+</resource-agent>
+EOF
+       return $OCF_SUCCESS
+}
+
+do_help() {
+       echo "pgpool (start|stop|reload|monitor|meta-data|validate-all|help)"
+       return $OCF_SUCCESS
+}
+
+do_validate_all() {
+       if [ "x$OCF_RESKEY_pgpoolconf" = "x" ] ; then
+               return $OCF_ERR_CONFIGURED
+       fi
+       if [ ! -e $OCF_RESKEY_pgpoolconf ] ; then
+               return $OCF_ERR_CONFIGURED
+       fi
+       if [ ! -x $PGPOOLCMD ] ; then
+               return $OCF_ERR_INSALLED
+       fi
+       if [ ! -x $PSQLCMD -a $OCF_RESKEY_checkmethod = "psql" ] ; then
+               return $OCF_ERR_INSALLED
+       fi
+       if [ ! -x $PCPNCCMD -a $OCF_RESKEY_checkmethod = "pcp" ] ; then
+               return $OCF_ERR_INSALLED
+       fi
+       if [ "x$PIDFILE" = "x" -a $OCF_RESKEY_checkmethod = "pid" ]
+       then
+               return $OCF_ERR_CONFIGURED
+       fi
+       return $OCF_SUCCESS
+}
+
+###### main
+
+case "$1" in
+       start)
+               do_start ;;
+       stop)
+               do_stop  ;;
+       reload)
+               do_reload  ;;
+       monitor|status)
+               do_monitor ;;
+       meta-data)
+               do_metadata ;;
+       promote|demote|migrate_to|migrate_from)
+               exit $OCF_ERR_UNIMPLEMENTED ;;
+       validate-all)
+               do_validate_all ;;
+       usage|help)
+               do_help ;;
+esac
+RC=$?
+
+ocf_log debug "${OCF_RESOURCE_INSTANCE}: $__OCF_ACTION returned $RC"
+
+exit $RC
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644 (file)
index 7483389..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Header$
-#
-
-TARGET = pgpool.monitor pgpool
-SRCS = pgpool.monitor.in pgpool.in
-PGPOOL=@PGPOOL@
-PSQL=@PSQL@
-INSTALL=@INSTALL@ -m 755
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-
-all: pgpool.monitor pgpool
-
-pgpool.monitor: pgpool.monitor.in
-       sed -e 's#@_PSQL_@#${PSQL}#g' < pgpool.monitor.in | \
-       sed -e 's#@_PGPOOL_@#${PGPOOL}#g' > pgpool.monitor
-pgpool: pgpool.in
-       sed -e 's#@_PSQL_@#${PSQL}#g' < pgpool.in | \
-       sed -e 's#@_PGPOOL_@#${PGPOOL}#g' > pgpool
-
-install: all
-       $(INSTALL_PROGRAM) pgpool /usr/lib/ocf/resource.d/heartbeat/
-       $(INSTALL_PROGRAM) pgpool.monitor ${PGPOOL}.monitor
-
-clean:
-       rm pgpool.monitor pgpool
-
diff --git a/src/pgpool.in b/src/pgpool.in
deleted file mode 100755 (executable)
index f705996..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/bin/sh
-#
-# OCF style start/stop/monitoring script for pgpool. use with heartbeat 2.1+
-#
-# Author: TANIDA Yutaka, TAKATSUKA Haruka
-#
-# Copyright (c) 2006-2012           PgPool Global Development Group 
-#
-# Permission to use, copy, modify, and distribute this software and
-# its documentation for any purpose and without fee is hereby
-# granted, provided that the above copyright notice appear in all
-# copies and that both that copyright notice and this permission
-# notice appear in supporting documentation, and that the name of the
-# author not be used in advertising or publicity pertaining to
-# distribution of the software without specific, written prior
-# permission. The author makes no representations about the
-# 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 options pgpooluser monitor_ip
-#
-#    default port number will be read from pgpool.conf automatically.
-
-check_pid () {
-       if [ -f $PGPOOL_PID ] 
-       then
-               kill -0 `cat $PGPOOL_PID` # >/dev/null 2>&1
-               return $?
-       else
-               return 1
-       fi
-}
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-export PATH
-PGPOOLCMD=@_PGPOOL_@
-
-if [ "x$OCF_RESKEY_pgpooluser" = 'x' ]; then
-       PGPOOLUSER=postgres
-else
-       PGPOOLUSER=$OCF_RESKEY_pgpooluser
-fi
-
-if [ "x$OCF_RESKEY_pgpoolconf" = 'x' ]; then
-       XX=$($PGPOOLCMD --help 2>&1 | grep ' config_file default path: ')
-       PGP_CONF=${XX#  config_file default path: }
-else
-       PGP_CONF=$OCF_RESKEY_pgpoolconf
-fi
-if [ "x$OCF_RESKEY_pcpconf" = 'x' ]; then
-       XX=$($PGPOOLCMD --help 2>&1 | grep '  pcp_config_file default path: ')
-       PCP_CONF=${XX#  pcp_config_file default path: }
-else
-       PCP_CONF=$OCF_RESKEY_pcpconf
-fi
-if [ "x$OCF_RESKEY_hbaconf" = 'x' ]; then
-       XX=$($PGPOOLCMD --help 2>&1 | grep '  hba_file default path: ')
-       HBA_CONF=${XX#  hba_file default path: }
-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
-if [ "x$OCF_RESKEY_pidfile" = 'x' ]; then
-       PGPOOL_PID=/tmp/pgpool.pid
-else
-       PGPOOL_PID=$OCF_RESKEY_pidfile
-fi
-if [ "x$OCF_RESKEY_monitor_ip" = 'x' ]; then
-       PGPOOL_MONITOR_IP=127.0.0.1
-else
-       PGPOOL_MONITOR_IP=$OCF_RESKEY_monitor_ip
-fi
-
-PGPOOL="$PGPOOLCMD -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$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 -n 2>&1 $LOGFILE &"
-       else
-        PGPOOL_START_ARG="$PGPOOL_START_ARG -n >>$LOGFILE 2>&1 &"
-    fi
-fi
-
-PGPOOL_STOP_ARG=" stop"
-PGPOOL_FORCE_STOP_ARG=" -m i $PGPOOL_STOP_ARG"
-PGPOOL_MONITOR=${PGPOOLCMD}.monitor 
-PGPOOL_MONITOR_ARGS="--conf=$PGP_CONF $PGPOOL_MONITOR_IP"
-
-# Source function library.
-. ${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 
-               ocf_log err "pgpool is already running."
-               exit 0
-       else
-               ocf_log info "pgpoolRA: su -c \" $PGPOOL $PGPOOL_START_ARG \" $PGPOOLUSER"
-               su -c "$PGPOOL $PGPOOL_START_ARG" $PGPOOLUSER
-               exit $?
-       fi
-       ;;
-       stop)
-       if check_pid
-       then
-               RET=`su -c "$PGPOOL $PGPOOL_FORCE_STOP_ARG | grep ERROR " $PGPOOLUSER`
-               ocf_log info "pgpoolRA: $RET"
-               if [ -z "$RET" ] ; then
-                       exit 0;
-               else
-                       exit 7;
-               fi
-       else
-               ocf_log info "pgpoolRA: request stop, but not running."
-               if which pkill ; then
-                       if pkill -P 1 pgpool ; then
-                               ocf_log info "pgpoolRA: purge orphaned pgpool processes."
-                               sleep 1
-                       fi
-               fi
-               exit 0 
-       fi
-       ;;
-       status)
-       if check_pid
-       then exit 0 # no error
-       else exit 2 # not running
-       fi
-       ;;
-       monitor)
-       if check_pid
-       then
-               $PGPOOL_MONITOR $PGPOOL_MONITOR_ARGS >/dev/null 2>&1
-               exit $?
-       else
-               exit 7 # stop or fail
-       fi
-       ;;
-       methods)
-       echo start
-       echo stop
-       echo status
-       echo methods        
-       echo monitor
-       echo recover
-       echo reload
-       ;;
-       recover|reload)
-       $0 stop
-       $0 start
-       exit 0
-       ;;
-       meta-data)
-cat <<EOF
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-  <resource-agent name="pgpool">
-   <version>1.0</version>
-   <longdesc lang="en">
-      OCF-spec start , stop ,and monitoring script for pgpool
-   </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.
-      </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>
-     <parameter name="pidfile" unique="0" required="0">
-      <longdesc lang="en">
-         Path to pgpool.pid
-      </longdesc>
-      <shortdesc lang="en">pidfile</shortdesc>
-      <content type="string" default="/tmp/pgpool.pid" />
-     </parameter>
-     <parameter name="options" unique="0" required="0">
-      <longdesc lang="en">
-         additional options of pgpool-II start command. (e.g. -d)
-      </longdesc>
-      <shortdesc lang="en">options</shortdesc>
-      <content type="string" default="" />
-     </parameter>
-     <parameter name="pgpooluser" unique="0" required="0">
-      <longdesc lang="en">
-         pgpool-II user. (e.g. "postgres"(default), "pgpool" or "root")
-      </longdesc>
-      <shortdesc lang="en">pgpool user</shortdesc>
-      <content type="string" default="postgres" />
-     </parameter>
-     <parameter name="monitor_ip" unique="0" required="0">
-      <longdesc lang="en">
-         pgpool-II monitor ip (e.g. "localhost"(default))
-      </longdesc>
-      <shortdesc lang="en">monitor ip</shortdesc>
-      <content type="string" default="localhost" />
-     </parameter>
-   </parameters>
-   <actions>
-    <action name="start"   timeout="20" />
-    <action name="stop"    timeout="20" />
-    <action name="status"  timeout="10" />
-    <action name="monitor" depth="0"  timeout="20" interval="10" start-delay="1m" />
-    <action name="recover"  timeout="20" />
-    <action name="reload"  timeout="20" />
-    <action name="meta-data"  timeout="5" />
-   </actions>
-  </resource-agent>
-EOF
-       exit 0;
-       ;;
-    *)
-       echo "Usage: $0 {start|stop|status|methods|reload|recover|meta-data|monitor}"
-       exit 7
-esac
-
-exit 0
diff --git a/src/pgpool.monitor.in b/src/pgpool.monitor.in
deleted file mode 100755 (executable)
index 003b25c..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/perl
-# Copyright (c) 2006-2007          PgPool Global Development Group 
-#
-#Permission to use, copy, modify, and distribute this software and
-#its documentation for any purpose and without fee is hereby
-#granted, provided that the above copyright notice appear in all
-#copies and that both that copyright notice and this permission
-#notice appear in supporting documentation, and that the name of the
-#author not be used in advertising or publicity pertaining to
-#distribution of the software without specific, written prior
-#permission. The author makes no representations about the
-#suitability of this software for any purpose.  It is provided "as
-#is" without express or implied warranty.
-#
-# $Id$
-#
-# arguments:
-#
-#  --username=username (postgres)
-#  --database=database (template1)
-#  --port= port no (5432)
-#    hostname
-#
-# A monitor program suitable for PostgreSQL , pgpool and pglb , load balancer process of PGCluster.
-#
-
-use Getopt::Long;
-
-sub dprint {
-       if($options{debug}) {
-            print @_;
-       }
-}
-
-GetOptions( \%options,"conf=s","debug=i","retry=i","psql=s","mode=s","port=i", "username=s", "password=s", "database=s" );
-
-#if($options{mode} eq "pgpool") {
-$query='show pool_status' ;
-#}else {
-#    $query='select 1';
-#}
-
-
-# read some configuration from pgpool.conf
-
-
-unless(!$options{conf}) {
-        dprint("read form conf");
-        open P,$options{conf} || die;
-        while(<P>) {
-                my $c=$_;
-                $c=~m/^port\s*=\s*(\d+)$/ && do {
-                        dprint("get port number from config $1\n");;
-                        $options{port}=$1;
-                };
-                $c=~m/^health_check_user\s*=\s*'(.*)'$/ && do {
-                        dprint("get health-check user and database name from config $1\n");;
-                        $u=$1;
-                        $options{database}=$u;
-                        $options{username}=$u;
-                }
-        }
-        close(P);
-}
-
-
-#default values.
-
-
-$options{port} = 9999 if ! $options{port};
-$options{database} = 'template1' if ! $options{database};
-$options{username} = 'postgres' if ! $options{username};
-$options{psql} = '@_PSQL_@' if ! $options{psql};
-$options{retry} = 3 if ! $options{retry};
-$options{debug} = 0 if ! $options{debug};
-
-
-
-
-# checking
-
-for $host( @ARGV ) {
-
-# $res is used for error_state checking (0..ok 1..need retry 2..immidiate error);
-# 3 .. means internal error. Retry immediately.
-#
-    my $res=1; 
-#retry count 
-    my $retry = $options{retry};
-    do {
-       my $openstr="$options{psql} -h $host -p $options{port} -U  $options{username} -c '$query' $options{database} 2>&1 |";
-
-       dprint "psql exec: ".$openstr."\n";
-
-       open(P,$openstr);
-       while(<P>) {
-
-
-           dprint $_;
-
-# command execution success.
-
-           ($res=0) if /^\(\d+ row[s]?\)/ ;
-           if (/server closed the connection unexpectedly/) {
-               $res=1;
-               $reason="unexpected backend crash.";
-           }
-
-# connection 
-            if (/could not connect to server:/) {
-               $res=1;
-               $reason="connection failed." 
-               }
-
-# 'not found' means something resource was not found.
-           if (/does not exist/) {
-               $res=2;
-               $reason="resource not found" ;
-           }
-
-# change mode from pgpool to postgresql if backend can not recognize 'pool_status' parameter.
-           if (/Option \'pool_status\' is not recognized/) {
-               $res=3;
-               $query="select 1";
-               $reason="It's not seems pgpool."; 
-           }
-# connection full ,it can retry . 
-           if (/backend connection is full/) {
-               $reason="unexpected connection full." ;
-           }
-
-# "starting up" will 
-           if (/is starting up/) {
-               $reason="too long startup";  
-           }
-# Containing "is recovery" will be recoverying processes. so we can wait long. 
-           if (/is recovery/) {
-               ++$retry ;
-           }
-       }
-       close(P);
-
-       dprint "result= $res , reason= $reason \n";
-
-# res
-
-       if($res==1 && $retry!=1) {
-           dprint "retry. reason = $reason \n";
-           sleep 2;
-       }elsif($res==3) {
-           $res=1;
-           ++$retry;
-       }               
-    }while ($res==1 && 0<--$retry);
-
-    if ($res!=0) {
-       push( @failures, "giving up to check database $options{database} on server $host. Reason:".$reason );
-    }
-
-}
-
-if (@failures) {
-    print join (", ", sort @failures), "\n";
-    dprint("pgpool.monitor failed.\n");    
-    exit 1;
-};
-dprint("pgpool.monitor succeeded.\n");
-exit 0;
-
diff --git a/test.sh b/test.sh
new file mode 100755 (executable)
index 0000000..55397e1
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+export OCF_ROOT=/usr/lib/ocf
+export OCF_RESOURCE_INSTANCE=test_res
+
+export OCF_RESKEY_pgpoolconf="/usr/local/etc/pgpool.conf"
+export OCF_RESKEY_pcpconf="/usr/local/etc/pcp.conf"
+export OCF_RESKEY_hbaconf="/usr/local/etc/pool_hba.conf"
+export OCF_RESKEY_logfile=""
+export OCF_RESKEY_options="-D"
+export OCF_RESKEY_pgpooluser="postgres"
+# export OCF_RESKEY_checkmethod="pid"
+# export OCF_RESKEY_checkstring=""
+# export OCF_RESKEY_checkmethod="pcp"
+# export OCF_RESKEY_checkstring="10 localhost 9898 postgres pass"
+export OCF_RESKEY_checkmethod="psql"
+export OCF_RESKEY_checkstring="-h localhost -U postgres -p 5432 -c \\'SELECT 1\\'"
+
+sh pgpool $*
+