Bug 1467939

Summary: Fatal error during installation after setting /var as a mountpoint
Product: Red Hat Enterprise Linux 7 Reporter: Michael Nguyen <mnguyen>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: jlebon, miabbott, systemd-maint-list, walters
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-15 07:39:19 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:
Attachments:
Description Flags
/tmp/anaconda.log file none

Description Michael Nguyen 2017-07-05 14:45:28 UTC
Description of problem:
Receiving a fatal error after setting up the disk to have /var in a separate partition.


Version-Release number of selected component (if applicable):
RHEL Atomic Host 7.4
Checksum: 8018f95c2f2f38a79e68f174dd5888b53769c0e4adcd89c87a802219091c9d0e

How reproducible:
Always


Steps to Reproduce:
1.  Boot up 7.4 ISO to Anaconda installer
2.  Select US English language/keyboard.
3.  Select 'Installation Destination'
4.  Select 'I will configure partitioning' under 'Other storage options'
5.  Click Done
6.  Click 'Click here to create them automatically'
7.  Click + and add /var as a mountpoint with a valid capacity for your configuration.  I used 5GiB.
8.  Click Done and confirm the changes.
9.  Click on 'Begin Installation'

Actual results:
The following error occurred while installing.  This is a fatal error and installation will be aborted.

systemd-tmpfiles ['--create', '--boot', '--root=/mnt/sysimage/ostree/deploy/rhel-atomic-host/deploy/8018f95c2f2f38a79e68f174dd5888b53769c0e4adcd89c87a802219091c9d0e.0', '--prefix=/var/lib/rpm'] exited with code 1

Expected results:
Successful installation of Atomic Host


Additional info:
I am installing through libvirt using the 7.4 Installation ISO.

Comment 2 Michael Nguyen 2017-07-05 15:22:19 UTC
Created attachment 1294657 [details]
/tmp/anaconda.log file

Comment 4 Colin Walters 2017-07-05 22:09:20 UTC
I noticed while debugging this that the systemd-tmpfiles we have is sort of ignoring `--prefix`; I get a bunch of files created if I do `--prefix=/var/home`.  But, things do succeed if I entirely drop `--prefix`.

The systemd in e.g. F26 works correctly with this.

Comment 5 Colin Walters 2017-07-06 01:37:24 UTC
I also confirmed that the RHEL 7.3 systemd-tmpfiles honors --prefix correctly.

Comment 6 Colin Walters 2017-07-07 21:30:12 UTC
So this patch gets us past the bug:

diff --git a/pyanaconda/packaging/rpmostreepayload.py b/pyanaconda/packaging/rpmostreepayload.py
index da7650d3b..003f3a05f 100644
--- a/pyanaconda/packaging/rpmostreepayload.py
+++ b/pyanaconda/packaging/rpmostreepayload.py
@@ -300,8 +300,12 @@ class RPMOSTreePayload(ArchivePayload):
         # matching NSS configuration inside Anaconda, and we can't "chroot" to
         # get it because that would require mounting the API filesystems in the
         # target.
-        for varsubdir in ('home', 'roothome', 'lib/rpm', 'opt', 'srv',
-                          'usrlocal', 'mnt', 'media', 'spool/mail'):
+        # Note this version differs from Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1467939
+        rpmdblink = iutil.getSysroot() + '/var/lib/rpm'
+        iutil.mkdirChain(os.path.dirname(rpmdblink))
+        os.symlink('../../usr/share/rpm', rpmdblink)
+        for varsubdir in ('home', 'roothome', 'opt', 'srv',
+                          'usrlocal', 'mnt', 'media'):
             self._safeExecWithRedirect("systemd-tmpfiles",
                                        ["--create", "--boot", "--root=" + iutil.getSysroot(),
                                         "--prefix=/var/" + varsubdir])

But...it reveals other bugs in Anaconda here; this bug seems worse in RHEL:
https://github.com/rhinstaller/anaconda/issues/1007#issuecomment-302184250

The kickstart workaround isn't bad, but the UX if you go through the interactive path is awful since, well, you can't log in to fix it (without init=/bin/sh).

So big picture, I think this is going to need a round of fixes in Fedora and we should try 7.5.

Comment 9 RHEL Program Management 2021-01-15 07:39:19 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.