Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 186411

Summary: rpm macro %{_sysconfdir} points to /usr/etc
Product: Red Hat Enterprise Linux 4 Reporter: Rainer Traut <rainer.traut>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0315 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-01 22:50:20 UTC Type: ---
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: 176344    

Description Rainer Traut 2006-03-23 13:56:24 UTC
Description of problem:
rpmbuild macro %{_sysconfdir} points to /usr/etc because rpm looks for
/usr/lib/rpm/ia32e-linux/macros

Version-Release number of selected component (if applicable):
rpm-4.3.3-13_nonptl
rpm-build-4.3.3-13_nonptl

How reproducible:
always, try to rebuild a src rpm with this macro or:
# rpm --eval %{_sysconfdir}
/usr/etc


Steps to Reproduce:
1. # rpm --eval %{_sysconfdir}
2. /usr/etc
3.
  
Actual results:


Expected results:
/etc

Additional info:
The macro %{_sysconfdir} is defined in a couple of files under /usr/lib/rpm/
always with the filename macros
But here on the 64bit version it tries to open:
open("/usr/lib/rpm/ia32e-linux/macros", O_RDONLY) = -1 ENOENT (No such file or
directory)
so the wrong path /usr/etc from /usr/lib/rpm/macros is used.
I did an strace:
# grep macros strace_rpm
open("/usr/lib/rpm/macros", O_RDONLY)   = 3
read(3, "#/*! \\page config_macros Default"..., 8192) = 8192
open("/usr/lib/rpm/ia32e-linux/macros", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/rpm/macros.jpackage", O_RDONLY) = 3
read(3, "#\n# RPM macros for Java applicat"..., 8192) = 6657
open("/etc/rpm/macros.prelink", O_RDONLY) = 3
open("/etc/rpm/macros.solve", O_RDONLY) = 3
open("/etc/rpm/macros.specspo", O_RDONLY) = 3
open("/etc/rpm/macros.up2date", O_RDONLY) = 3
open("/etc/rpm/macros", O_RDONLY)       = -1 ENOENT (No such file or directory)
open("/etc/rpm/ia32e-linux/macros", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/root/.rpmmacros", 0x7fbfffe180)  = -1 ENOENT (No such file or directory)

Comment 1 Jeff Johnson 2006-03-23 20:33:35 UTC
The %{_sysconfdir} macro is overridden by per-platform macros
    -14: _sysconfdir        /etc

Edit /etc/rpm/platform, and change "ia32e" to "x86_64" is one fix.
Otherwise
    ln -s x86_64-linux /usr/lib/rpm/ia32e-linux

Comment 2 Rainer Traut 2006-03-24 13:16:54 UTC
The symlink was what I thought of, too.
I did:
ln -s /usr/lib/rpm/x86_64-linux/ /usr/lib/rpm/ia32e-linux

and now it works:

# rpm --eval %{_sysconfdir}
/etc

Thx
Rainer

Comment 6 Jeff Johnson 2006-08-07 18:24:52 UTC
This bug is likely fixed (by setting arch as "x86_64" from --target) in rpm-4.4.7-0.15.

UPSTREAM

Comment 7 RHEL Program Management 2006-08-18 16:25:07 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 15 Red Hat Bugzilla 2007-05-01 22:50:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0315.html