Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionFred van Zwieten
2015-05-28 07:12:35 UTC
Description of problem:
There is a need to clean content from a directory based on age, but only if the directory exists. Filetype D in a tmpfiles.d conf file doesn't work, because it will create the directory if it doesn't exist. R doesn't use the age parameter.
Version-Release number of selected component (if applicable):
How reproducible:
Use a tmpfiles conf of:
D /root/saplogs 755 root root 5d -
Steps to Reproduce:
1. Create a /etc/tmpfiles.d/tmpfiles conf of: "D /root/saplogs 755 root root 5d -"
2. run systemd-tmpfiles --clean
3. look at /root, there how is a subdir "saplogs"
Actual results:
a directory /root/saplogs exists
Expected results:
nothing happened
Additional info:
Propose to have the age parameter also work for r and R filetypes. This is imo backwards compatible and as such an enhancement.
application admin installs sap components using sudo. sap leaves install logs in /root in a subdir saplog/. application admins cannot remove those because of permissions. sys admins want this directory cleaned out after x days. If the subdir saplog/ doesn't exist, nothing have to happen.
(In reply to Fred van Zwieten from comment #3)
Uh this is so wrong. User who does not have access to /root directory runs an application which writes logs to /root? At least please tell you customer to file a bug against sap to move those to /var.
Tmpfilesd is about actions which happens repeatedly, what you want to do is just plan some action to the future. Also remove actions are only bound to boot (we only call /usr/bin/systemd-tmpfiles --clean in the timer).
I spend quite a lot of time thinking about a sane use-case, but I haven't found one. I really think that introducing such possibility would lead to really bad practices like the one above.
(In reply to Lukáš Nykrýn from comment #5)
Reopening this bug as I think there is a valid use case.
> (In reply to Fred van Zwieten from comment #3)
> Uh this is so wrong. User who does not have access to /root directory runs
> an application which writes logs to /root?
You are absolutely right but there are other uses cases.
With RHEL7, systemd-tmpfiles seems to have deprecated tmpwatch. The latter is
not installed by default and for example the X11 lock files are now cleaned by
/usr/lib/tmpfiles.d/x11.conf. Lets say, the customer just wants to use the new
technology as shipped with RHEL7 to clean a file in some directory under, lets
say, /var. Though if it doesn't exists (i.e. some application did not create
the directory yet), it should not be created as part of a housekeeping job.
> Tmpfilesd is about actions which happens repeatedly, what you want to do is
> just plan some action to the future. Also remove actions are only bound to
> boot (we only call /usr/bin/systemd-tmpfiles --clean in the timer).
Yes, and when the r/R type has an age defined, they should be actioned by
--clean as well (triggered by the timer).
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-2017:2297