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 1668408

Summary: Block systemd-tmpfiles from deleting the lorax installtree during boot.iso creation
Product: Red Hat Enterprise Linux 8 Reporter: Brian Lane <bcl>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact: Vladimír Slávik <vslavik>
Priority: unspecified    
Version: 8.0CC: atodorov, jstodola, sbueno, wchadwic
Target Milestone: rcFlags: rule-engine: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 28.14.23-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1668520 (view as bug list) Environment:
Last Closed: 2019-06-13 23:06:11 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:
Bug Depends On:    
Bug Blocks: 1668520    

Description Brian Lane 2019-01-22 16:46:05 UTC
For some time there has been an intermittent problem with boot.iso creation where the /proc system in the installroot would vanish during the install. adamw finally managed to track it down using the fedora openqa system and some tests he added and the problem ends up being that systemd-tmpfiles has a 30d rule on /var/tmp/ where lorax installs the rpms. Some of the timestamps, especially from the filesystem package, are older than 30 days. So if systemd-tmpfiles runs during a build it will erase some of the files and directories. It runs 15m after boot and once a day, which explains why it was so hard to track down.

Upstream systemd has proposed a fix using locks, but in the meantime I have this work-around which will prevent it from happening:

https://github.com/weldr/lorax/pull/571

This also requires a SELinux change, otherwise the temporary directories aren't completely deleted at boot time (they leave shadow- and opasswd, so it won't fill up the filesystem, but looks messy).

The Fedora selinux-policy bug is #1668054

Comment 2 Brian Lane 2019-01-22 18:00:09 UTC
After discussing the SELinux change with Lukas Vrabec it's obvious that I'll have to come up with a different way to cleanup orphaned lorax tempdirs -- we cannot allow tmpfiles to cleanup the shadow files w/o compromising security for the whole system. I'll post a new PR soon.

Comment 7 Jan Stodola 2019-02-08 15:23:35 UTC
Reproduced using lorax-28.14.22-1.el8 and calling "/usr/bin/systemd-tmpfiles --clean" while lorax was running - this broke the process in different ways depending on when systemd-tmpfiles was executed.

Verified using lorax-28.14.23-1.el8, the installation images were successfully created while running:
# while sleep 1; do /usr/bin/systemd-tmpfiles --clean; done
during the whole lorax process. The created boot.iso successfully booted in a VM.

Moving to VERIFIED.