debian/0000755000000000000000000000000012160041560007161 5ustar debian/tests/0000755000000000000000000000000012160041526010325 5ustar debian/tests/connect0000755000000000000000000000245412160041526011711 0ustar #!/bin/sh # autopkgtest script for pgbouncer: starts a pgbouncer instance and connects # through it to a postgres server running on port 5432 # autopkgtest's TMPDIR is not readable for postgres unset TMPDIR if [ -z "$WRAPPED" ]; then WRAPPED=1 pg_virtualenv $0 "$@" exit fi /etc/init.d/pgbouncer stop set -e # prepare cleanup at exit CLEAN_FILES="/etc/pgbouncer/pgbouncer.ini /etc/pgbouncer/userlist.txt /etc/default/pgbouncer" cleanup () { /etc/init.d/pgbouncer stop || : for f in $CLEAN_FILES; do test -f $f.adt-save && mv -f $f.adt-save $f done } trap cleanup 0 2 3 15 # set up minimal pgbouncer config sed -i.adt-save -e '/\[databases\]/ apostgres =' /etc/pgbouncer/pgbouncer.ini cp -a /etc/pgbouncer/userlist.txt /etc/pgbouncer/userlist.txt.adt-save echo "\"$PGUSER\" \"$PGPASSWORD\"" >> /etc/pgbouncer/userlist.txt sed -i.adt-save -e 's/START=0/START=1/' /etc/default/pgbouncer # start pgbouncer and test connection /etc/init.d/pgbouncer start echo "Trying simple SELECT ..." result=$(psql -p 6432 -d postgres -c "SELECT 1+2" -tA) echo "$result" [ "$result" = "3" ] echo "Result OK" echo "Trying online restart ..." ( echo "SELECT 3+4;" /etc/init.d/pgbouncer restart > /dev/null echo "SELECT 5+6;" ) | psql -p 6432 -d postgres -tA > output [ "$(cat output)" = "7 11" ] echo "Result OK" rm -f output debian/tests/control0000644000000000000000000000007712160040136011730 0ustar Tests: connect Depends: @, postgresql Restrictions: needs-root debian/install0000644000000000000000000000004312044702222010547 0ustar etc/pgbouncer.ini /etc/pgbouncer/ debian/init0000755000000000000000000000445512160040136010060 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: pgbouncer # Required-Start: $local_fs $remote_fs $network $syslog $named # Required-Stop: $local_fs $remote_fs $network $syslog $named # Should-Start: postgresql # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start pgbouncer # Description: pgbouncer is a connection pool server and replication # proxy for PostgreSQL. ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=pgbouncer DAEMON=/usr/sbin/$NAME PIDDIR=/var/run/postgresql PIDFILE=$PIDDIR/$NAME.pid OPTS="-d /etc/pgbouncer/$NAME.ini" RUNASUSER="postgres" # Include pgbouncer defaults if available if [ -f /etc/default/pgbouncer ] ; then . /etc/default/pgbouncer fi # Exit if we were uninstalled with the config still there test -x $DAEMON || exit 0 # Check if configuration exists test -f $CONF || exit 0 . /lib/lsb/init-functions SSD="start-stop-daemon --pidfile $PIDFILE --exec $DAEMON --quiet" case "$1" in start) # Check if we are still disabled in /etc/default/pgbouncer [ "${START:-}" = "0" ] && exit 0 log_daemon_msg "Starting PgBouncer" $NAME test -d $PIDDIR || install -d -o postgres -g postgres -m 2775 $PIDDIR $SSD --start --chuid $RUNASUSER --oknodo -- $OPTS 2> /dev/null log_end_msg $? ;; stop) log_daemon_msg "Stopping PgBouncer" $NAME $SSD --stop --retry 30 --oknodo log_end_msg $? ;; reload | force-reload) log_daemon_msg "Reloading PgBouncer configuration" $NAME $SSD --stop --signal HUP --oknodo log_end_msg $? ;; restart) # we would use "$SSD --status" here if it were available in squeeze $SSD --stop --signal 0 if [ $? -eq 0 ] ; then OLDPID=$(cat $PIDFILE) log_daemon_msg "Invoking PgBouncer restart" $NAME su -c "$DAEMON -R $OPTS 2> /dev/null" - $RUNASUSER # sleep until the process has changed PID for t in 0.1 0.2 0.2 0.5 1.0 1.0 2.0; do # 5s in total NEWPID=$(cat $PIDFILE 2>/dev/null) [ "$NEWPID" ] && [ "$NEWPID" != "$OLDPID" ] && break echo sleep $t sleep $t done $SSD --stop --signal 0 log_end_msg $? else $0 start fi ;; status) status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" exit 1 ;; esac debian/README.Debian0000644000000000000000000000060612055114276011234 0ustar pgbouncer for Debian -------------------- General usage information can be found at http://wiki.postgresql.org/wiki/PgBouncer Package-specific notes: - The default directory for the socket and PID file is /var/run/postgresql, as known from the postgresql package. - The pgbouncer daemon is disabled by default, to enable it you need to set START to 1 in /etc/default/pgbouncer. debian/patches/0000755000000000000000000000000012160040136010606 5ustar debian/patches/series0000644000000000000000000000001612160040136012020 0ustar debian-config debian/patches/debian-config0000644000000000000000000000074412055114276013235 0ustar --- a/etc/pgbouncer.ini +++ b/etc/pgbouncer.ini @@ -28,8 +28,8 @@ ;;; Administrative settings ;;; -logfile = /var/log/pgbouncer/pgbouncer.log -pidfile = /var/run/pgbouncer/pgbouncer.pid +logfile = /var/log/postgresql/pgbouncer.log +pidfile = /var/run/postgresql/pgbouncer.pid ;;; ;;; Where to wait for clients @@ -44,6 +44,7 @@ ;unix_socket_dir = /tmp ;unix_socket_mode = 0777 ;unix_socket_group = +unix_socket_dir = /var/run/postgresql ;;; ;;; Authentication settings debian/postinst0000644000000000000000000000035612044702222010773 0ustar #!/bin/sh set -e if [ "$1" = configure ] && [ -z "$2" ]; then chown postgres:postgres /etc/pgbouncer/pgbouncer.ini /etc/pgbouncer/userlist.txt chmod u=rw,g=r,o= /etc/pgbouncer/pgbouncer.ini /etc/pgbouncer/userlist.txt fi #DEBHELPER# debian/docs0000644000000000000000000000001412044702222010027 0ustar NEWS README debian/source/0000755000000000000000000000000012055114276010471 5ustar debian/source/options0000644000000000000000000000005012055114276012102 0ustar extend-diff-ignore = lib/usual/config.h debian/source/format0000644000000000000000000000001412055114276011677 0ustar 3.0 (quilt) debian/examples0000644000000000000000000000004312044702222010717 0ustar etc/pgbouncer.ini etc/userlist.txt debian/copyright0000644000000000000000000000201412055114276011121 0ustar This package was debianized by Fernando Ike de Oliveira on Mon, 18 Jun 2007 14:40:29 -0300. It was downloaded from . Upstream Authors: Sven Suursoho , Marko Kreen Copyright (C) 2007-2011 Marko Kreen, Skype Technologies Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. debian/watch0000644000000000000000000000014212160040136010205 0ustar version=3 http://pgfoundry.org/frs/?group_id=1000258 .*/[0-9]+/pgbouncer-([0-9.]+).(?:tgz|tar.gz) debian/default0000644000000000000000000000043412044702222010531 0ustar # Set to 1 after you've configured pgbouncer in # /etc/pgbouncer START=0 # It is possible to change the options the daemon is started with. # The default setting is shown below, uncomment and apply your changes # if you need to modify it. #OPTS="-d /etc/pgbouncer/pgbouncer.ini" debian/control0000644000000000000000000000223112160040135010557 0ustar Source: pgbouncer Maintainer: Christoph Berg Uploaders: Bernd Zeimetz , Peter Eisentraut Section: database Priority: optional Standards-Version: 3.9.3 Build-Depends: cdbs, debhelper (>= 7), libevent-dev (>= 1.3b), asciidoc, xmlto, python Homepage: http://pgfoundry.org/projects/pgbouncer/ Vcs-Git: git://anonscm.debian.org/pkg-postgresql/pgbouncer.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-postgresql/pgbouncer.git XS-Testsuite: autopkgtest Package: pgbouncer Architecture: any Depends: lsb-base (>= 3.1), postgresql-common (>= 26), ${misc:Depends}, ${shlibs:Depends} Enhances: postgresql (>= 7.4) Description: lightweight connection pooler for PostgreSQL PgBouncer is a lightweight connection pooler for PostgreSQL providing the following features: . * Several levels of brutality when rotating connections: session pooling, transaction pooling, statement pooling. * Low memory requirements. * It is not tied to one backend server, the destination databases can reside on different hosts. * Supports online reconfiguration for most of the settings. * Supports online restart/upgrade. debian/rules0000755000000000000000000000100712160040136010235 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS := --bindir=/usr/sbin DEB_MAKE_EXTRA_ARGS += V=1 DEB_DH_INSTALLINIT_ARGS := -R clean:: find doc -name "pgbouncer.*" -exec rm {} \; rm -f doc/*.xml install/pgbouncer:: rm -f $(addprefix $(CURDIR)/debian/pgbouncer/usr/share/doc/pgbouncer/,pgbouncer.ini userlist.txt) mkdir -p $(CURDIR)/debian/pgbouncer/etc/pgbouncer touch $(CURDIR)/debian/pgbouncer/etc/pgbouncer/userlist.txt debian/compat0000644000000000000000000000000212055114276010367 0ustar 7 debian/changelog0000644000000000000000000002541312160041555011044 0ustar pgbouncer (1.5.4-4) unstable; urgency=low * Use PGUSER/PGPASSWORD in debian/tests/connect; unset TMPDIR. -- Christoph Berg Tue, 18 Jun 2013 13:11:40 +0200 pgbouncer (1.5.4-3) experimental; urgency=low [ Peter Eisentraut ] * Use log_daemon_msg and log_end_msg to print output from init script. * Fix watch file (from Bart Martens via qa.debian.org) * Disable silent make rules, per buildd log scanner [ Christoph Berg ] * On restart, loop until the PID of the process changed instead of sleeping a fixed time. Closes: #698942. * Do not use start-stop-daemon --status yet as it is not available in squeeze. Use ssd --stop --signal 0 instead. * debian/tests/connect: Test online restart. -- Christoph Berg Fri, 22 Mar 2013 15:27:42 +0100 pgbouncer (1.5.4-2) experimental; urgency=low * Add autopkgtest support. -- Christoph Berg Mon, 07 Jan 2013 16:32:47 +0100 pgbouncer (1.5.4-1) experimental; urgency=low * New upstream release. * Add .gitignore file. -- Christoph Berg Tue, 11 Dec 2012 10:10:16 +0100 pgbouncer (1.5.3-1) experimental; urgency=low * New upstream release. -- Christoph Berg Sun, 07 Oct 2012 19:24:30 +0200 pgbouncer (1.5.2-3) unstable; urgency=low * Re-add check for START=0 in the init script. Spotted by Sergey Burladyan. Closes: #687577. * Repository moved to git. -- Christoph Berg Sun, 07 Oct 2012 19:16:34 +0200 pgbouncer (1.5.2-2) unstable; urgency=low * Init script: Use --oknodo. Closes: #681978. Create /var/run/postgresql when missing. Closes: #681372. -- Christoph Berg Thu, 26 Jul 2012 13:12:23 +0200 pgbouncer (1.5.2-1) unstable; urgency=low * New upstream release. -- Christoph Berg Mon, 11 Jun 2012 17:52:32 +0200 pgbouncer (1.5.1-1) unstable; urgency=low [ Peter Eisentraut ] * Remove duplicate userlist.txt from doc directory [ Christoph Berg ] * Replace lsb init functions with plain echo. Spotted by Alexey Potehin. * Refresh debian-changes patch, most of our changes went upstream. -- Christoph Berg Mon, 30 Apr 2012 14:31:35 +0200 pgbouncer (1.5-1) unstable; urgency=low [ Peter Eisentraut ] * Update watch file to allow .tar.gz in addition to .tgz * Remove obsolete README.source and repack support in watch file [ Christoph Berg ] * New upstream release. * Use start-stop-daemon for stopping the daemon. Closes: #641568. * Use pgbouncer -R to restart in place, thanks Cody Cutrer for the patch. Closes: #657204. * Update URL in README.Debian. Closes: #655283. -- Christoph Berg Fri, 27 Jan 2012 17:40:22 +0100 pgbouncer (1.4.2-2) unstable; urgency=low * Honor START=0 for the restart action. Patch by Chris Lamb, thanks! Closes: #640796. -- Christoph Berg Thu, 08 Sep 2011 09:45:23 +0200 pgbouncer (1.4.2-1) unstable; urgency=low * New upstream release. -- Christoph Berg Fri, 17 Jun 2011 15:41:53 +0200 pgbouncer (1.4.1-1) unstable; urgency=low * New upstream release. * Remove the endian patch, implemented upstream. * Use source format 3.0 (quilt) because the upstream tarball has its own debian/ dir. Ignore lib/usual/config.h in source/options. -- Christoph Berg Tue, 12 Apr 2011 13:42:40 +0200 pgbouncer (1.4-2) unstable; urgency=low * Add myself as maintainer. * Use the system endian.h on *bsd. Closes: #619676 * Add quilt to Build-Depends. * Move debian/config.patch to quilt and comment out example databases in config file. * Update long description. -- Christoph Berg Wed, 30 Mar 2011 17:29:39 +0200 pgbouncer (1.4-1) unstable; urgency=low * New upstream release. * Remove .orig file after patching pgbouncer.ini -- Bernd Zeimetz Mon, 14 Feb 2011 13:26:29 +0100 pgbouncer (1.3.3-2) unstable; urgency=low * Added myself to uploaders * Fixed debian/copyright to match reality * Updated standards version * Install configuration files with more secure permissions (closes: #548887) -- Peter Eisentraut Thu, 05 Aug 2010 21:57:00 +0300 pgbouncer (1.3.3-1) unstable; urgency=low * New upstream version. * Bumping Standards-Version to 3.8.4, no changes needed. * Removing dpatch - no patches needed anymore since several releases. * Use source format 1.0 for easy backporting. -- Bernd Zeimetz Sun, 16 May 2010 03:15:41 +0200 pgbouncer (1.3.2-1) unstable; urgency=low * New upstream version. -- Bernd Zeimetz Wed, 24 Mar 2010 23:10:02 +0100 pgbouncer (1.3.1-3) unstable; urgency=low * Really change the init script now - unfortunately the old one found its way back into the package. -- Bernd Zeimetz Sun, 24 Jan 2010 12:24:34 +0100 pgbouncer (1.3.1-2) unstable; urgency=low * Chaging Section to database, which is the new section for database related tools. * Require $remote_fs on start/stop in the init script. (Lintian: init.d-script-missing-dependency-on-remote_fs) * Use pgbouncer as the name the init script provides instead of pgbouncer2. (Lintian: init.d-script-does-not-provide-itself) -- Bernd Zeimetz Sun, 24 Jan 2010 00:55:35 +0100 pgbouncer (1.3.1-1) unstable; urgency=low * New upstream release. * debian/init: Use reload instead of restart when force-reload was called, thanks to Peter Eisentraut for the bug report. Closes: #538006 * Ensure that pgbounce stops, even if clients are connected. Thanks to Cyril Bouthors for the patch. Closes: #523066 * Bumping Standards-Version to 3.8.2, no changes needed. -- Bernd Zeimetz Thu, 23 Jul 2009 16:23:52 +0200 pgbouncer (1.3-1) unstable; urgency=low [ Fernando Ike de Oliveira ] * New upstream release. * debian/init: - pgbouncer.log and start script duplicated start message were removed. - patch that change pgbouncer to port 6432 (default upstream) was removed * debian/config.patch. - pgbouncer.ini patch new version was fixed. * win32 directory was removed from the original source code. [ Bernd Zeimetz ] * debian/watch, debian/uscan-repack.sh: Adding script to repackage upstream source with uscan automatically. The included debian and win32 dir will be removed. -- Bernd Zeimetz Sun, 01 Mar 2009 03:48:18 +0100 pgbouncer (1.2.3-2) unstable; urgency=low * debian/control: - pgbouncer needs a versioned dependency on libevent-dev (>= 1.3b). * debian/init: - Implementing reload by sending SIGHUP to the daemon. - Better start/stop log messages. * debian/default: - Explain how to change the daemon options. -- Bernd Zeimetz Tue, 30 Sep 2008 10:42:06 +0200 pgbouncer (1.2.3-1) unstable; urgency=low [ Fernando Ike de Oliveira ] * New upstream Release. * Change listen port to 5433. * Added fields Enhances and Conflicts. [ Bernd Zeimetz ] * Changes done by Fernando Ike de Oliveira, but without a proper changelog entry: - The new upstream release closes: #499531 - debian/control: Depend on postgresql-common to make sure the postgres user exists (Closes: #499521). - Fixed init script, not using -n option anymore (Closes: #499522) - Bumping Standards-Version to 3.8.0 * Adding myself to Uploaders. * The following changes are a general cleanup of the package, unfortunately these things were never detected by the former sponsor. Sorry Fernando, but I also have to revert some of your recent changes. - debian/control: * Fixing the long description, removing the copy of the short description from it and switch to a better indenting. * Adding python as Build-Dependency, upstream is using it to fix the generated manpages. * Removing extra blank lines. * pgbouncer supports PostgreSQL versions 7.4 and higher, changing the Enhances field accordingly. * Dropping Conflicts field again. It's not a problem to install pgpool/pgpool2 on the same machine with pgbouncer. * Lowering the Dependency on lsb-base, 3.1 is enough to support the new init script. - debian/rules: * Don't gzip examples manually, dh_compress will handle it according to the policy. * Dropping DEB_INSTALL_MANPAGES_pgbouncer definition, upstream installs the manpages into the right place. * Don't include /usr/share/cdbs/1/rules/utils.mk and /usr/share/cdbs/1/rules/buildcore.mk, cdbs takes care of that. * DEB_UPDATE_RCD_PARAMS: pgbouncer should start *after* PostgreSQL and needs to stop before it. Changing to 'defaults 20 18' therefore. * Don't install pgbouncer.ini.examples in the doc directory, use dh_installexamples to install into the examples directory instead. * Create an empty userlist.txt in /etc/pgbouncer - debian/pgbouncer.8: * Dropping file, upstream provides a manpage. - debian/init: * renaming debian/init.d to debian/init - that's the filename dh_installinit takes care of. * Respect the setting of 'START' in /etc/default/pgbouncer. The option was ignored completely. - debian/install: * Renamed from pgbouncer.install. * Don't install an example userlist to /etc. File will be touched in debian/rules. Install it as example instead. - debian/examples: * Adding file, installing ini-file and userlist example. - debian/config.patch, debian/patches/default-port.dpatch: * Changing default port to 6432 as upstream's default conflicts with X11. 5433 is also a bad choice as postgres instances may use this port dynamically. - debian/patches/01_configtxt: * Dropping patch, not needed anymore. - debian/patches/00list: * Updated accordingly. - debian/README.source: * Adding file to make the package conform to Standards Version 3.8.0. - debian/default: * Adding short explanation. - debian/README.Debian * Several spelling fixes. -- Bernd Zeimetz Fri, 26 Sep 2008 18:47:34 +0200 pgbouncer (1.1.2.1-1) unstable; urgency=low * Change section contrib to main and regenerate .orig.tar.gz.(Closes: #474288) * Fix error in script pgbouncer.prerm changed init.d to similar pgpool2. (Closes: #471114) * Change dependency to "$shlibs:Depends". (Closes: #461383) * Build instead postgresql-8.3 (Closes: #474283) * Added suggest dependency postgresql package. -- Fernando Ike de Oliveira Tue, 05 Aug 2008 14:31:58 -0300 pgbouncer (1.1.2-1) unstable; urgency=low * Initial Release. (Closes: #427238) -- Fernando Ike de Oliveira Wed, 12 Dec 2007 16:22:15 -0200