Bug 1315935
Summary: | glusterfs-libs postun scriptlet fail /sbin/ldconfig: relative path `1' used to build cache | ||
---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Kaleb KEITHLEY <kkeithle> |
Component: | packaging | Assignee: | Kaleb KEITHLEY <kkeithle> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.7.8 | CC: | barumuga, bitlord0xff, bugs, extras-qa, humble.devassy, joe, jonathansteffan, kkeithle, lmohanty, ndevos |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | glusterfs-3.7.9 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | 1315024 | Environment: | |
Last Closed: | 2016-04-08 11:24: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: | |||
Bug Depends On: | 1145989, 1312374, 1315024 | ||
Bug Blocks: |
Description
Kaleb KEITHLEY
2016-03-09 03:44:52 UTC
REVIEW: http://review.gluster.org/13650 (packaging: rpm scriptlet cleanup, handle -p /sbin/ldconfig) posted (#1) for review on release-3.7 by Kaleb KEITHLEY (kkeithle) COMMIT: http://review.gluster.org/13650 committed in release-3.7 by Vijay Bellur (vbellur) ------ commit 73f415353b0d70a4e6e4a4cedc05cd9b8418625f Author: Kaleb S KEITHLEY <kkeithle> Date: Tue Mar 8 22:50:41 2016 -0500 packaging: rpm scriptlet cleanup, handle -p /sbin/ldconfig The RPM documention indicates that during an rpm install or erase, the script(lets): %post, %preun, and %postun (and %pre, %build, %install, etc.) are copied to a temp file, and then the temp file is run as a (/bin/sh or bash) script. Unfortunately the documentation is not clear about how rpmbuild and/or rpm determine where the end of any scriptlet is when it is copied to the file. Most things in the glusterfs.spec work correctly as is. These are the %preun, %post, and %postun scriptlets that are "closed" by a following %preun, %post, and %postun, or poetentially another scriptlet, e.g. %file. The ones that don't work correctly (only one actually) are those where there is a comment in the spec file before it is closed by another scriptlet. Further complicating things is that the type of scriptlet affects what rpm does and what `rpm -qp --scripts ...` shows. The specific one that didn't work was the "%postun libs" scriptlet. It is followed by a comment before being "closed" by the %files section (or scriptlet). It can be written two ways: "%postun libs\n/sbin/ldconfig" or "%postun libs -p /sbin/ldconfig" Either way it's written, `rpm -qp --scripts glusterfs-libs...` will include the comment lines between the %postun libs line and the following %files line. But the way rpm executes these depends on how they're written. If written as "%postun libs\n/sbin/ldconfig" rpm will simply run /sbin/ldconfig with no command line options, i.e. execve ("/sbin/ldconfig", [ "/sbin/ldconfig" ], [ ]); But when written as "%postun libs -p /sbin/ldconfig", it will copy the comment lines to a temp file, and pass the temp file name and "1" as (command line) parameters, i.e. execve ("/sbin/ldconfig", [ "/sbin/ldconfig", "/tmp/tmpXXXXXX", "1" ], [ ]); Which results in ldconfig exiting with an error. (Remember, both ways show the comment in `rpm -qp --scripts ...`) (Note though, that the similar "%postun api -p /sbin/ldconfig" is run correctly, because it is "closed" by the following "%postun server" scriptlet.) Finally, through trial and error, it appears that rpm can be tricked with a hack, and "closure" of the scriptlet forcedlike this: %postun libs -p /sbin/ldconfig %if ( 0%{?_undocumented_hack_closes_scriptlets} ) %postun %endif in which case ldconfig appears to run correctly. Note also that here too the comment will be included in the output of `rpm -qp --scripts ...` But that's very ugly hack. backport of: >Change-Id: I587a490ddcdf47d01605479bc8ef8b0e439108fb >BUG: 1315024 >Reviewed-on http://review.gluster.org/#/c/13613/ Change-Id: Ia45162ba0282db00026b3da5396811fdef5e6515 BUG: 1315935 Signed-off-by: Kaleb S KEITHLEY <kkeithle> Reviewed-on: http://review.gluster.org/13650 Smoke: Gluster Build System <jenkins.com> NetBSD-regression: NetBSD Build System <jenkins.org> Reviewed-by: Niels de Vos <ndevos> CentOS-regression: Gluster Build System <jenkins.com> 3.7.10 This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.9, please open a new bug report. glusterfs-3.7.9 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] https://www.gluster.org/pipermail/gluster-users/2016-March/025922.html [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user |