From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.30126.1796191221304783092 for ; Tue, 01 Dec 2026 22:00:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=dN8UJ/9p; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: bbnpreetsingh@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3b41188c8b9so8104338a91.0 for ; Tue, 01 Dec 2026 22:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796191221; x=1796796021; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+Pj8DX2w9torD0sb97mYquqg83hblb6fnZn7DOISbdw=; b=dN8UJ/9pkq1MTpU0r9VPdzZQNGnb4Eakodo0Tn+I/3PZTkChhZGH79EWs9++LPYL/6 97LItFfHE9x6pVIS8gw4bTafN/sN0MJUYx9PmAO0Xlcq0fErDoXnBm/x8rPtqNazE//m MMICZ4o4HFAPMvGZjgNNlbQwUw1x0/xeNt9UWsO964HClsXGUR+zoM7E18+Zt2lJ6PMI 4HhgR9f8zeg0hYvKmOygoA5/eIbRCisle5+o0MVsj085C2/GAic14Y3MdtaKs2ZMuYQs 991OJdXcch6FL6Pw4ORF2jq/LpSPyvAtr0XlmgaVgGKzKYdVL++UG7MnKGlFBbCqj6DY czOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796191221; x=1796796021; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+Pj8DX2w9torD0sb97mYquqg83hblb6fnZn7DOISbdw=; b=rotROyfqsqBZl7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EO/cT+bNjcJ3MpVbZxsHn1T126ziQ6ukoIkus168YXmIhs4iNmrszREu3iy2tQ= X-Received: by 2002:a17:90b:2e47:b0:3b4:a63:d56d with SMTP id 98e67ed59e1d1-3b41c7e119bmr40262784a91.1.1796191220392; Tue, 01 Dec 2026 22:00:20 -0800 (PST) Return-Path: Received: from localhost.localdomain ([108.180.159.198]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5a17a9bd1sm7075259a91.9.2026.12.01.22.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 22:00:19 -0800 (PST) From: Babanpreet Singh To: openembedded-devel@lists.openembedded.org Cc: Khem Raj , Babanpreet Singh Subject: [meta-networking][PATCH v2] pgbouncer: add recipe Date: Wed, 2 Dec 2026 06:00:18 +0000 Message-ID: <20261202060018.7-1-bbnpreetsingh@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 02 Dec 2026 06:00:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133802 Content-Type: text/plain; charset="utf-8" PgBouncer is a lightweight connection pooler for PostgreSQL. AI-Generated: Uses Claude (claude-opus-5-5) Signed-off-by: Babanpreet Singh --- .../pgbouncer/pgbouncer/pgbouncer.init | 56 +++++++++++++++++++ .../pgbouncer/pgbouncer/pgbouncer.service | 18 ++++++ .../pgbouncer/pgbouncer_1.26.1.bb | 56 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.init create mode 100644 meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.service create mode 100644 meta-networking/recipes-support/pgbouncer/pgbouncer_1.26.1.bb diff --git a/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.init b/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.init new file mode 100644 index 0000000000..5a153cd97b --- /dev/null +++ b/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.init @@ -0,0 +1,56 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: pgbouncer +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Connection pooler for PostgreSQL +### END INIT INFO + +DAEMON=/usr/bin/pgbouncer +CONF=/etc/pgbouncer/pgbouncer.ini +PIDFILE=/var/run/pgbouncer/pgbouncer.pid + +test -x $DAEMON || exit 0 +test -f $CONF || exit 0 + +stop() { + start-stop-daemon -K -q -p $PIDFILE -x $DAEMON -s INT + for i in 1 2 3 4 5 6 7 8 9 10; do + [ -f $PIDFILE ] && kill -0 "$(cat $PIDFILE)" 2>/dev/null || return 0 + sleep 1 + done +} + +case "$1" in +start) + echo -n "Starting pgbouncer: " + mkdir -p /var/run/pgbouncer /var/log/pgbouncer + chown pgbouncer:pgbouncer /var/run/pgbouncer /var/log/pgbouncer + if start-stop-daemon -S -q -p $PIDFILE -c pgbouncer -x $DAEMON -- -d $CONF; then + echo "done" + else + echo "failed" + exit 1 + fi + ;; +stop) + echo -n "Stopping pgbouncer: " + stop + echo "done" + ;; +reload) + start-stop-daemon -K -q -p $PIDFILE -x $DAEMON -s HUP + ;; +restart) + $0 stop + $0 start + ;; +*) + echo "Usage: $0 {start|stop|reload|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.service b/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.service new file mode 100644 index 0000000000..212b02d7a6 --- /dev/null +++ b/meta-networking/recipes-support/pgbouncer/pgbouncer/pgbouncer.service @@ -0,0 +1,18 @@ +[Unit] +Description=Connection pooler for PostgreSQL +Documentation=https://www.pgbouncer.org/ +After=network-online.target +Wants=network-online.target + +[Service] +Type=notify +User=pgbouncer +RuntimeDirectory=pgbouncer +LogsDirectory=pgbouncer +ExecStart=/usr/bin/pgbouncer /etc/pgbouncer/pgbouncer.ini +ExecReload=/bin/kill -HUP $MAINPID +KillSignal=SIGINT +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/meta-networking/recipes-support/pgbouncer/pgbouncer_1.26.1.bb b/meta-networking/recipes-support/pgbouncer/pgbouncer_1.26.1.bb new file mode 100644 index 0000000000..f4eaca0f44 --- /dev/null +++ b/meta-networking/recipes-support/pgbouncer/pgbouncer_1.26.1.bb @@ -0,0 +1,56 @@ +SUMMARY = "Lightweight connection pooler for PostgreSQL" +HOMEPAGE = "https://www.pgbouncer.org/" +BUGTRACKER = "https://github.com/pgbouncer/pgbouncer/issues" +LICENSE = "BSD-1-Clause AND BSD-3-Clause AND ISC AND PostgreSQL" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=d5f4369a96e12a98e8695033381d6c28 \ + file://src/common/base64.c;beginline=6;endline=6;md5=e3aa2c2a657829cd2a61898e8fdde49b \ + file://src/common/sha2.c;beginline=23;endline=48;md5=f924a973f231ccd44fa85d7938a71ece \ + file://include/common/uthash.h;beginline=1;endline=21;md5=894975335149e863524c4d27839e8cfa \ + " + +SRC_URI = "https://www.pgbouncer.org/downloads/files/${PV}/${BP}.tar.gz \ + file://pgbouncer.init \ + file://pgbouncer.service \ + " +SRC_URI[sha256sum] = "00886a2994b4844cd37110970df777772cfc42a74c400522c82fba509a3f42d9" + +UPSTREAM_CHECK_URI = "https://www.pgbouncer.org/downloads/" +UPSTREAM_CHECK_REGEX = "pgbouncer-(?P\d+(\.\d+)+)\.tar\.gz" + +DEPENDS = "libevent" + +inherit autotools-brokensep pkgconfig systemd update-rc.d useradd + +CLEANBROKEN = "1" + +EXTRA_AUTORECONF += "-I ${S}/lib/m4" + +PACKAGECONFIG ??= "openssl cares ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}" +PACKAGECONFIG[openssl] = "--with-openssl --with-root-ca-file=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-openssl,openssl,,ca-certificates" +PACKAGECONFIG[cares] = "--with-cares,--without-cares,c-ares" +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" +PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap" +PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" + +EXTRA_OEMAKE += "dist_man_MANS=" + +do_install:append() { + install -d ${D}${sysconfdir}/pgbouncer + install -m 0640 -g pgbouncer ${S}/etc/pgbouncer.ini ${D}${sysconfdir}/pgbouncer/ + install -m 0640 -g pgbouncer /dev/null ${D}${sysconfdir}/pgbouncer/userlist.txt + install -D -m 0755 ${UNPACKDIR}/pgbouncer.init ${D}${sysconfdir}/init.d/pgbouncer + install -D -m 0644 ${UNPACKDIR}/pgbouncer.service ${D}${systemd_system_unitdir}/pgbouncer.service +} + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "--system --home-dir /nonexistent --no-create-home --shell /sbin/nologin --user-group pgbouncer" + +INITSCRIPT_NAME = "pgbouncer" +INITSCRIPT_PARAMS = "start 65 . stop 35 0 1 2 3 4 5 6 ." + +SYSTEMD_SERVICE:${PN} = "pgbouncer.service" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" + +CONFFILES:${PN} = "${sysconfdir}/pgbouncer/pgbouncer.ini \ + ${sysconfdir}/pgbouncer/userlist.txt \ + " -- 2.43.0