From nobody Sun Apr 23 17:19:23 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q4FP81QNHz46BtR; Sun, 23 Apr 2023 17:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q4FP721Vfz3tJD; Sun, 23 Apr 2023 17:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682270363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pP7YysqLHNxF3MCyVimTjq+y7w7RcCk4jwJUIjzVP/Y=; b=DqAK2qJoiJ+7xia9tlSbOU4Akj2JjZXDfuVIMUi0KyIJbs8CUb1Bbimyyj1dT+TDEmAKIw btRH3M8OgXJxELrl3MQDTxlZhM9+qSpACQcJ2cRMYLWUzgHZpfPqcfVoVZrjZmejV4au2j SvTBIUeuhdlL9D3ogxfdFhG9GUkNTWyaF1QZM+e6LBWZfduQQJ3pH54cdDj/80+gRadq5r /vU7aKHb2vZPJ5AFNljty6+uEgyOVHrWZMmkZFQai+i6AVDa9b3XwO8MbzSqXUTYCpqJOd DGa8tMJ4vhg66P145oq939uKof35mr5WjFsPPMvFQWQSpN7mET42vw1Orr19JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682270363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pP7YysqLHNxF3MCyVimTjq+y7w7RcCk4jwJUIjzVP/Y=; b=hgfPJCHDmLFDu00AACiwVuEAfBCBHlWp3clGH+Fud23Ko2TjXKuz8FbaLAOrhZoHBb/5gr 9Ipj0hrADUqMptAe3nylqA/q/rSmXUPaASuyBMIGij/nr62Q2ikvRsrM/cgdewQE+BMpry gzX1nCkX1mDjSZ/TZnYJqp06gbDj2KmcsMuu7aeeyboU7fhdjFR8ZyUBVefv6js1J+UEVB lhoehthDsMO34jVSr81kqs+bovHyYc+qU1CtGOzUYRQfUSuc9T0l7fa8SpUmw5rxMTDiTS vgXT+LfJBUICpaANwsIUnV+al1vI2bReNZzoQStj3BoaTGZp0jPwOw1IpIsRkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682270363; a=rsa-sha256; cv=none; b=mRLw8M8fvqLHO4vtXOFuMNL75HLJdHetvM5aafZ/34Px1Q1Nc3Iyzx+PuThoXpVTZrerCs fjVCq18v8ntNXWgSC4+bAfDNZy3hglWFa+Y4l/QSPoMMwMz+ZRv1EQpgiyOSrDjAiBzKd5 GN2/bsQkD6S7ShFgYjaIV8YTnkp1K6S9Ch67CBdOWBAg39VpksDlz5JY5KKu09Wk9gEGxC R92IhP03bKSuKaVdMiSoTDgOH7W5D8DhDtUwPBzXevTMHPQ+oetxQsxdnYnWAZ/JLipfiR JQXpfyoPf78Wo2L1liO+hu4u+ITfNUnwh7/GjgURjaHuu8FgQaR5JBoXaLME0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q4FP711qgzs4q; Sun, 23 Apr 2023 17:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33NHJNOb061800; Sun, 23 Apr 2023 17:19:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33NHJNEO061799; Sun, 23 Apr 2023 17:19:23 GMT (envelope-from git) Date: Sun, 23 Apr 2023 17:19:23 GMT Message-Id: <202304231719.33NHJNEO061799@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: e7de14f3bb72 - main - databases/pgbouncer: add a graceful stop command to rc script List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7de14f3bb723e71746fb2179aafbe8d897c0b62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=e7de14f3bb723e71746fb2179aafbe8d897c0b62 commit e7de14f3bb723e71746fb2179aafbe8d897c0b62 Author: Dmitry Wagin AuthorDate: 2023-04-23 15:28:39 +0000 Commit: Robert Clausecker CommitDate: 2023-04-23 17:17:49 +0000 databases/pgbouncer: add a graceful stop command to rc script The user can now terminate pgbouncer both with gracefulstop (sends SIGINT) and with stop (sends SIGTERM). PR: 271023 --- databases/pgbouncer/Makefile | 1 + databases/pgbouncer/files/pgbouncer.in | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/databases/pgbouncer/Makefile b/databases/pgbouncer/Makefile index f157b30ea9bd..391de975a740 100644 --- a/databases/pgbouncer/Makefile +++ b/databases/pgbouncer/Makefile @@ -1,5 +1,6 @@ PORTNAME= pgbouncer PORTVERSION= 1.18.0 +PORTREVISION= 1 CATEGORIES= databases MASTER_SITES= https://pgbouncer.github.io/downloads/files/${PORTVERSION}/ \ http://pgbouncer.github.io/downloads/files/${PORTVERSION}/ diff --git a/databases/pgbouncer/files/pgbouncer.in b/databases/pgbouncer/files/pgbouncer.in index 5abb3925c2cc..ded6ed6cc112 100644 --- a/databases/pgbouncer/files/pgbouncer.in +++ b/databases/pgbouncer/files/pgbouncer.in @@ -13,6 +13,7 @@ # Default is "%%PREFIX%%/etc/pgbouncer.ini". # pgbouncer_flags (string): Additional flags passed to pgbouncer. # Default is "". +# pgbouncer_sig_stop (str): Default to "TERM" . /etc/rc.subr @@ -24,11 +25,26 @@ load_rc_config "$name" : ${pgbouncer_user="pgbouncer"} : ${pgbouncer_conf="%%PREFIX%%/etc/$name.ini"} -extra_commands="reload" +gracefulstop_cmd="pgbouncer_gracefulstop" +stop_precmd="pgbouncer_prestop" + +extra_commands="reload gracefulstop" command="%%PREFIX%%/bin/pgbouncer" pidfile="%%PGBOUNCER_RUNDIR%%/$name.pid" required_files="${pgbouncer_conf}" command_args="-d ${pgbouncer_conf}" +pgbouncer_gracefulstop() +{ + echo "Performing a graceful stop:" + sig_stop="INT" + run_rc_command ${rc_prefix}stop ${rc_extra_args} || return 1 +} + +pgbouncer_prestop() +{ + sig_stop="${pgbouncer_sig_stop:-TERM}" +} + run_rc_command "$1"