Bug 2364112

Summary: pgbouncer log file not deleted on rotation
Product: [Fedora] Fedora EPEL Reporter: Nels Lindquist <nels>
Component: pgbouncerAssignee: Fabian Affolter <mail>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: epel8CC: devrim, mail, negativo17, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: pgbouncer-1.24.1-2.el9 pgbouncer-1.24.1-3.el10_1 pgbouncer-1.24.1-5.fc42 pgbouncer-1.24.1-5.fc41 pgbouncer-1.24.1-3.el8 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-23 02:50:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nels Lindquist 2025-05-05 16:15:13 UTC
Description of problem:

The logrotate script included with the package does not currently kill -HUP the pgbouncer daemon after log rotation. As per the PgBouncer documentation (https://www.pgbouncer.org/config.html), the log file is kept open and sending a -HUP signal is required. The "active" log file is kept open (but marked deleted) after rotation, and over time can eventually fill the volume holding the log files.

This was discovered after noting a huge discrepancy between the output of df and du on a nearly full volume, and subsequent investigation using 'lsof | grep "/var" | grep deleted', which showed a 23 GB deleted but still open pgbouncer.log.1 file.

After restarting pgbouncer, the space was freed up.

Version-Release number of selected component (if applicable):

Current version (1.24.1-2) is affected; presumably any prior versions with similar logrotate script would also be affected.


How reproducible:


Steps to Reproduce:
1. Install and configure pgbouncer with default logging configuration
2. Allow scheduled log rotation to occur
3. lsof | grep "/var" | grep deleted

Actual results:
"/var/log/pgbouncer/pgbouncer.log.[n] (deleted)" shows up in the open file list.

Expected results:
Rotated log files should be released after deletion.


Additional info:
The logrotate script provided with the pgbouncer package via the pgdg-common repository includes a number of additional options vs the epel 8 script, including a kill -HUP:

/var/log/pgbouncer/pgbouncer.log {
        missingok
        copytruncate
        compress
        notifempty
        sharedscripts
        create 0640 pgbouncer pgbouncer
        nodateext
        weekly
        rotate 5
        postrotate
                /bin/kill -HUP `cat /var/run/pgbouncer/pgbouncer.pid  2>/dev/null` 2> /dev/null || true
        endscript
}

Comment 1 Fedora Update System 2025-05-15 13:28:04 UTC
FEDORA-EPEL-2025-03f6fa9f17 (pgbouncer-1.24.1-2.el9) has been submitted as an update to Fedora EPEL 9.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-03f6fa9f17

Comment 2 Fedora Update System 2025-05-15 13:28:05 UTC
FEDORA-2025-79a3de7290 (pgbouncer-1.24.1-5.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-79a3de7290

Comment 3 Fedora Update System 2025-05-15 13:28:05 UTC
FEDORA-EPEL-2025-e51947524f (pgbouncer-1.24.1-3.el10_1) has been submitted as an update to Fedora EPEL 10.1.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-e51947524f

Comment 4 Fedora Update System 2025-05-15 13:28:06 UTC
FEDORA-2025-ddb2717b8c (pgbouncer-1.24.1-5.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-ddb2717b8c

Comment 5 Fedora Update System 2025-05-16 00:21:05 UTC
FEDORA-EPEL-2025-03f6fa9f17 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-03f6fa9f17

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2025-05-16 00:38:44 UTC
FEDORA-EPEL-2025-e51947524f has been pushed to the Fedora EPEL 10.1 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-e51947524f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2025-05-16 01:36:13 UTC
FEDORA-2025-79a3de7290 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-79a3de7290`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-79a3de7290

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-05-16 01:58:07 UTC
FEDORA-2025-ddb2717b8c has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-ddb2717b8c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-ddb2717b8c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2025-05-16 02:48:55 UTC
FEDORA-EPEL-2025-f13602481f has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2025-f13602481f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2025-05-23 02:50:10 UTC
FEDORA-EPEL-2025-03f6fa9f17 (pgbouncer-1.24.1-2.el9) has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2025-05-23 03:03:56 UTC
FEDORA-EPEL-2025-e51947524f (pgbouncer-1.24.1-3.el10_1) has been pushed to the Fedora EPEL 10.1 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2025-05-23 03:25:07 UTC
FEDORA-2025-ddb2717b8c (pgbouncer-1.24.1-5.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2025-05-23 03:56:28 UTC
FEDORA-2025-79a3de7290 (pgbouncer-1.24.1-5.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2025-05-24 00:32:42 UTC
FEDORA-EPEL-2025-f13602481f (pgbouncer-1.24.1-3.el8) has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.