RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1272236 - Logrotate does not support RO root anymore. The state file needs to move from /var/lib/logrotate.status to /var/lib/logrotate/status and rwtab entry should be changed to "dirs /var/lib/logrotate".
Summary: Logrotate does not support RO root anymore. The state file needs to move fro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: logrotate
Version: 7.3
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: Vaclav Danek
Maxim Svistunov
URL:
Whiteboard:
: 1325458 1383655 (view as bug list)
Depends On: 1127415 1355632
Blocks: 1203710 1289025 1295829 1313485
TreeView+ depends on / blocked
 
Reported: 2015-10-15 20:04 UTC by Thomas Gardner
Modified: 2023-09-18 00:11 UTC (History)
11 users (show)

Fixed In Version: logrotate-3.8.6-12.el7
Doc Type: Release Note
Doc Text:
The *logrotate* utility now saves status to the `/var/lib/logrotate/` directory Previously, the *logrotate* utility saved status to the `/var/lib/logrotate.status` file. Consequently, *logrotate* did not work on systems where `/var/lib` was a read-only file system. With this update, the status file has been moved to the new `/var/lib/logrotate/` directory, which can be mounted with write permissions. As a result, *logrotate* now works on systems where `/var/lib` is a read-only file system.
Clone Of:
Environment:
Last Closed: 2016-11-04 08:25:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:2545 0 normal SHIPPED_LIVE logrotate bug fix and enhancement update 2016-11-03 14:19:45 UTC

Description Thomas Gardner 2015-10-15 20:04:03 UTC
Description of problem:

Please see https://bugzilla.redhat.com/show_bug.cgi?id=625034 and
https://bugzilla.redhat.com/show_bug.cgi?id=1127415 for history.

Basically in 625034 the rewriting of the status file was was changed
from a simple open to and write to an open a temporary file, write,
and if all writes are successful, reanme to the real state file due
to problems caused when the root FS was full.

Then came 1127415 (opened against Fedora) because in fixing 625034,
we messed up running on a RO root FS system.  Unfortunately, this
case was closed without being fixed because the Fedora version it
was filed against went EOL before the fix could get in, and it was
never changed to the next version.

The /etc/rwtab has:

files	/var/lib/logrotate.status

in it, but you can't create /var/lib/logrotate.status.tmp (read only
FS), and even if you were to add:

files   /var/lib/logrotate.status.tmp

to the rwtab, you wouldn't be able to rename that file to
/var/lib/logrotate.status once written.  We need to change the default
status file from /var/lib/logrotate.status to /var/lib/logrotate/status
and then change this status file's entry in /etc/rwtab to:

dirs   /var/lib/logrotate/status

so that logrotate can work with RO root FSes again.

Version-Release number of selected component (if applicable):
Whatever the latest RHEL7 version is.

How reproducible:
Every time.

Steps to Reproduce:
1. Install a proper RO root RHEL7 system.
2. Try running logrotate in the usual way.
3. Get some popcorn (optional).
4. Sit back and enjoy the show.

Actual results:
Logrotate fails with "error creating output file
/var/lib/logrotate.status.tmp: Read-only file system"

Expected results:
Logrotate should work.  :-)

Additional info:
Please leave this BZ public so the customer can follow it.  So far there
is no non-public information in it.  Please keep it that way, or if non-public information must be put in, please just do so in a private comment.

Comment 1 Jan Kaluža 2015-10-19 06:40:37 UTC
This is already done in Fedora and could be backported to rhel7.

Comment 7 Milos Malik 2016-07-14 08:44:33 UTC
The package should own the directory in which logrotate.status is located:

# rpm -qf /var/lib/logrotate/
file /var/lib/logrotate is not owned by any package
# rpm -qf /var/lib/logrotate/logrotate.status 
logrotate-3.8.6-11.el7.x86_64
#

Comment 10 Kamil Dudka 2016-07-14 09:04:51 UTC
(In reply to Milos Malik from comment #7)
> The package should own the directory in which logrotate.status is located:
> 
> # rpm -qf /var/lib/logrotate/
> file /var/lib/logrotate is not owned by any package
> # rpm -qf /var/lib/logrotate/logrotate.status 
> logrotate-3.8.6-11.el7.x86_64
> #

fixed in logrotate-3.9.2-4.fc25

Comment 13 Kamil Dudka 2016-09-02 11:15:57 UTC
*** Bug 1325458 has been marked as a duplicate of this bug. ***

Comment 14 Kamil Dudka 2016-10-11 11:40:52 UTC
*** Bug 1383655 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2016-11-04 08:25:56 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://rhn.redhat.com/errata/RHEA-2016-2545.html

Comment 22 Red Hat Bugzilla 2023-09-18 00:11:53 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.