Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1769894

Summary: Rotated and deleted log files kept open until smart-proxy is restarted
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: Foreman ProxyAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.6.0CC: aruzicka, bkearney, inecas, mschibli, pcreech, trichard, vsedmik, zhunting
Target Milestone: 6.6.1Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1750248 Environment:
Last Closed: 2019-12-04 21:12:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 3 Lukas Pramuk 2019-11-22 13:35:08 UTC
VERIFIED.

@satellite-6.6.1-1.el7sat.noarch
foreman-proxy-1.22.0.3-1.el7sat.noarch

by the following manual reproducer:

1) Check that foreman-proxy is running

# ps -efH | grep foreman\\-proxy
foreman+ 11631     1  0 Nov20 ?        00:00:24   ruby /usr/share/foreman-proxy/bin/smart-proxy --no-daemonize
foreman+ 11789     1  0 Nov20 ?        00:00:35   ruby /usr/bin/smart_proxy_dynflow_core -d -p /var/run/foreman-proxy/smart_proxy_dynflow_core.pid

2) Check that there are already logrotated files (as Satellite is running for couple of days)

# ll /var/log/foreman-proxy/proxy*.gz
-rw-r--r--. 1 foreman-proxy foreman-proxy 3972 Nov 20 23:50 /var/log/foreman-proxy/proxy.log-20191121.gz
-rw-r--r--. 1 foreman-proxy foreman-proxy  223 Nov 21 23:50 /var/log/foreman-proxy/proxy.log-20191122.gz

3) Check for presence of logrotated (deleted) log files being kept open

# lsof | grep '/var/log.* (deleted)'

REPRO:

ruby      11631       foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631       foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby-time 11631 11632 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby-time 11631 11632 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11634 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11634 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11635 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11635 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11636 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11636 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11649 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11649 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11650 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11650 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11659 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11659 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)
ruby      11631 11685 foreman-proxy    7u      REG              253,0     36912  478164178 /var/log/foreman-proxy/proxy.log-20191121 (deleted)
ruby      11631 11685 foreman-proxy   11u      REG              253,0       562  478164207 /var/log/foreman-proxy/proxy.log-20191122 (deleted)

vs. 

FIX:

<empty>

>>> the foreman-proxy log files are logrotated properly without keeping deleted files open

Comment 5 errata-xmlrpc 2019-12-04 21:12:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:4103