Bug 1139276
| Summary: | when building mockroot $PATH may not be set for %post | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Pat Riehecky <riehecky> | ||||||
| Component: | pam | Assignee: | Tomas Mraz <tmraz> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Dalibor Pospíšil <dapospis> | ||||||
| Severity: | low | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 7.0 | CC: | csieh, dapospis, misterbonnie, riehecky | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | pam-1.1.8-11.el7 | Doc Type: | Bug Fix | ||||||
| Doc Text: |
no doc text needed
|
Story Points: | --- | ||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2015-03-05 10:25:55 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: |
|
||||||||
I am not able to reproduce this issue. Even the reported version build without any error in my RHEL7 VM. Is there something what I could do to make it fail? I get it 100% of the time on an EL7 host running mock building an EL7 changeroot. I've been using mock-1.1.41-2.el7 from EPEL. I'll attach a mock config I can replicate the problem with. Created attachment 946396 [details]
mock config for replication
I still cannot get reproduction. I have no deep knowledge of mock.
With the config of yours I get missing useradd in chroot and with modified your config + my repos I get correct build without errors.
Actually I tried to use following config. Could you identify what needs to be changed?
# Auto-generated by the Koji build system
config_opts['environment']['LANG'] = os.environ.setdefault('LANG', 'en_US.UTF-8')
config_opts['environment']['TZ'] = os.environ.setdefault('TZ', 'CST6CDT')
config_opts['chroothome'] = '/builddir'
config_opts['use_host_resolv'] = False
config_opts['basedir'] = '/var/lib/mock'
config_opts['rpmbuild_timeout'] = 86400
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['yum_cache_enable'] = False
config_opts['plugin_conf']['ccache_enable'] = False
config_opts['macros']['%_host'] = 'x86_64-koji-linux-gnu'
config_opts['macros']['%_host_cpu'] = 'x86_64'
config_opts['macros']['%vendor'] = 'Koji'
config_opts['macros']['%distribution'] = 'Koji Testing'
config_opts['macros']['%_topdir'] = '/builddir/build'
config_opts['macros']['%_rpmfilename'] = '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
config_opts['macros']['%packager'] = 'Koji'
config_opts['root'] = 'mockbuild-library'
config_opts['target_arch'] = 'x86_64'
config_opts['chroot_setup_cmd'] = 'install @build @base @development '
config_opts['dist'] = 'el7' # only useful for --resultdir variable subst
config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
# repos
...
Try: config_opts['chroot_setup_cmd'] = 'install @build @base @core @development' In theory @core should be automatic, but being explicit can sometimes help clear things up. Still no luck with reproducing the issue. After a discussion with devel I decided to leave the bug verified as SanityOnly. This means the change is in place so the scripts now use absolute paths. That works for me. 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://rhn.redhat.com/errata/RHBA-2015-0453.html |
Created attachment 935361 [details] patch to resolve Description of problem: when setting up a mockroot, $PATH may not be set for %post which results in an error in the logs. Using %{_bindir} to set path to install prevents this error Version-Release number of selected component (if applicable): How reproducible:100 Steps to Reproduce: 1.build a RHEL7 mockbuild root, look for errors in root.log 2. 3. Actual results: DEBUG util.py:283: /var/tmp/rpm-tmp.6T2Ig8: line 3: install: command not found DEBUG util.py:283: warning: %post(pam-1.1.8-9.el7.x86_64) scriptlet failed, exit status 127 DEBUG util.py:283: Non-fatal POSTIN scriptlet failure in rpm package pam-1.1.8-9.el7.i686 Expected results: no errors Additional info: attached patch resolves using standard rpm macros