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.

Bug 1317849

Summary: systemd-tmpfiles cleanup old directories with content
Product: Red Hat Enterprise Linux 7 Reporter: W. de Heiden <wdh>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: carsten.grohmann, dtardon, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 07:40:30 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 W. de Heiden 2016-03-15 11:06:23 UTC
Description of problem:
systemd-tmp can clean directory, however, it only seems capable of cleaning the content nnot the directories

Version-Release number of selected component (if applicable):
RHEL 7.x, Fedora

How reproducible:
The ipa-backup tool (for example) will create some "unpredictable" subdirectories. That is: the exact name of the directories is not known since the name contains a timestamp:

[root@ipa backup]# ls -lrt /var/lib/ipa/backup/
total 84
drwx------. 2 root root 16384 Feb 19 16:14 lost+found
drwx------. 2 root root  4096 Feb 19 16:16 ipa-data-2016-02-19-16-16-43
drwx------. 2 root root  4096 Feb 19 16:18 ipa-data-2016-02-19-16-18-38
drwx------. 2 root root  4096 Feb 20 03:20 ipa-data-2016-02-20-03-20-28
drwx------. 2 root root  4096 Feb 21 03:20 ipa-data-2016-02-21-03-20-28
drwx------. 2 root root  4096 Feb 22 03:44 ipa-data-2016-02-22-03-44-28
drwx------. 2 root root  4096 Feb 23 03:13 ipa-data-2016-02-23-03-13-29
drwx------. 2 root root  4096 Feb 24 03:51 ipa-data-2016-02-24-03-51-27
drwx------. 2 root root  4096 Feb 25 03:22 ipa-data-2016-02-25-03-22-27
drwx------. 2 root root  4096 Feb 26 03:20 ipa-data-2016-02-26-03-20-27
drwx------. 2 root root  4096 Feb 27 03:35 ipa-data-2016-02-27-03-35-30
drwx------. 2 root root  4096 Feb 28 03:39 ipa-data-2016-02-28-03-39-28
drwx------. 2 root root  4096 Feb 29 03:29 ipa-data-2016-02-29-03-29-27
drwxr-xr-x. 3 root root  4096 Mar  1 03:34 logs

Now, using this configuration file for cleanup old backups:

cat /etc/tmpfiles.d/ipa-backup.conf 
## man 5 tmpfiles.d
d /var/lib/ipa/backup/ipa-data-* 0700 root root 7d
d /var/lib/ipa/backup/logs/* 0700 root root 7d 

The directory /var/lig/ipa/backup/logs will get cleaned up properly, files are removed after 7 days.


Actual results:
Old backups  in /var/lib/ipa/backup/ipa-data-* removed after 7 days, including the directory itself. Dispite this config, old backups are not removed.

Expected results:
Removed old directories, including content


Additional info:

Changing d for r or R will not work since the Age is only accepted for s, D and x (man 5 tmpfiles.d)

R /var/lib/ipa/backup/ipa-data-* 0700 root root 7d
R /var/lib/ipa/backup/logs/* 0700 root root 7d

Comment 4 RHEL Program Management 2020-12-15 07:40:30 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.