Skip to content

pgbouncer: add new package#29094

Open
carson0321 wants to merge 1 commit intoopenwrt:masterfrom
carson0321:master
Open

pgbouncer: add new package#29094
carson0321 wants to merge 1 commit intoopenwrt:masterfrom
carson0321:master

Conversation

@carson0321
Copy link
Copy Markdown

📦 Package Details

Maintainer: @carson0321

Description:
Pgbouncer is lightweight connection pooler for PostgreSQL.
https://www.pgbouncer.org/


🧪 Run Testing Details

  • OpenWrt Version: 24.10
  • OpenWrt Target/Subtarget: mt7988
  • OpenWrt Device: mt7988

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

Signed-off-by: carson.wang <r03944040@ntu.edu.tw>
@carson0321 carson0321 changed the title feat: add PgBouncer package for PostgresSQL connection pool pgbouncer: add new package Apr 8, 2026
@BKPepe BKPepe requested a review from Copilot April 17, 2026 08:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new OpenWrt package for PgBouncer, including default configuration and an init script to run it under procd.

Changes:

  • Introduce libs/pgbouncer package Makefile to build/install PgBouncer.
  • Add default pgbouncer.ini and userlist.txt under /etc/pgbouncer.
  • Add /etc/init.d/pgbouncer procd init script with user/setup logic.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
libs/pgbouncer/Makefile Defines the new package build/install steps and dependencies.
libs/pgbouncer/files/pgbouncer.init Adds procd init script, including user creation and directory setup.
libs/pgbouncer/files/pgbouncer.ini Adds a default PgBouncer configuration template.
libs/pgbouncer/files/userlist.txt Adds a sample/auth file template for users/password hashes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/pgbouncer/Makefile
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=COPYRIGHT

PKG_INSTALL:=1
Comment thread libs/pgbouncer/Makefile
Comment on lines +51 to +52
$(INSTALL_DIR) $(PKG_BUILD_DIR)/ipkg-install/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/pgbouncer $(PKG_BUILD_DIR)/ipkg-install/usr/bin/
Comment thread libs/pgbouncer/Makefile
Comment on lines +60 to +62
define Package/pgbouncer/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pgbouncer $(1)/usr/bin/
Comment thread libs/pgbouncer/Makefile
SUBMENU:=Database
TITLE:=Lightweight connection pooler for PostgreSQL
URL:=https://www.pgbouncer.org/
DEPENDS:=+libevent2 +libc +libpthread +libopenssl +libpq +pgsql-cli +pgsql-server
Comment on lines +17 to +24
setup_user() {
if ! grep -q "^${PGBOUNCER_GROUP}:" /etc/group; then
echo "${PGBOUNCER_GROUP}:x:888:" >> /etc/group
fi

if ! grep -q "^${PGBOUNCER_USER}:" /etc/passwd; then
echo "${PGBOUNCER_USER}:x:888:888:PgBouncer:/var/lib/pgbouncer:/bin/false" >> /etc/passwd
fi
* = host=127.0.0.1 port=5432

[pgbouncer]
listen_addr = 0.0.0.0
Comment on lines +13 to +15
auth_type = scram-sha-256
auth_file = /etc/pgbouncer/userlist.txt
auth_user = pgbouncer_auth
Comment on lines +35 to +39
chmod 755 /var/log/pgbouncer
chmod 755 /var/run/pgbouncer
chmod 755 /var/lib/pgbouncer
chmod 755 /etc/pgbouncer
chmod 644 /etc/pgbouncer/pgbouncer.ini
Comment on lines +35 to +39
chmod 755 /var/log/pgbouncer
chmod 755 /var/run/pgbouncer
chmod 755 /var/lib/pgbouncer
chmod 755 /etc/pgbouncer
chmod 644 /etc/pgbouncer/pgbouncer.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants