[packages/rpm] skip ldconfig optimization

glen glen at pld-linux.org
Tue May 31 22:44:26 CEST 2016


commit 8c28fc02688ea15524dc143d1d0df4a8bf4e3287
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue May 31 23:44:02 2016 +0300

    skip ldconfig optimization
    
    http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024910.html

 rpm.spec                         |  4 ++-
 skip-ldconfig-optimization.patch | 74 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 1 deletion(-)
---
diff --git a/rpm.spec b/rpm.spec
index 2d6d3bb..1c6d227 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -51,7 +51,7 @@ Summary(ru.UTF-8):	Менеджер пакетов от RPM
 Summary(uk.UTF-8):	Менеджер пакетів від RPM
 Name:		rpm
 Version:	5.4.15
-Release:	33
+Release:	34
 License:	LGPL v2.1
 Group:		Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm
@@ -182,6 +182,7 @@ Patch92:	fast_python_deps.patch
 Patch93:	python2_explicit.patch
 Patch94:	do_not_write_before_macro_buffer.patch
 Patch95:	rpm-python-spec-header.patch
+Patch96:	skip-ldconfig-optimization.patch
 
 # Patches imported from Mandriva
 
@@ -1022,6 +1023,7 @@ cd -
 %patch93 -p1
 %patch94 -p1
 %patch95 -p1
+%patch96 -p1
 
 %patch1050 -p1
 
diff --git a/skip-ldconfig-optimization.patch b/skip-ldconfig-optimization.patch
new file mode 100644
index 0000000..917a8fc
--- /dev/null
+++ b/skip-ldconfig-optimization.patch
@@ -0,0 +1,74 @@
+http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024910.html
+
+patch from jbj answer:
+http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2016-May/024913.html
+
+On May 31, 2016, at 2:52 AM, Elan Ruusamäe wrote:
+
+> On 31.05.2016 09:45, Elan Ruusamäe wrote:
+>> [root at 57c8cccdc671 bin]# poldek -u procps 
+> oh, and it's 100% reproducible:
+>
+
+Yes. And it has been discussed many times over the last 15y,
+several times on this list.
+
+Short answer:
+	Disable the mechanism with attached patch to lib/psm.c
+		- OR --
+	Don't use
+		%scriptlet -p /sbin/ldconfig
+	in packages that are known to invoke an executable that depends on
+	a new library.
+
+Longer answer:
+	Libraries often have scriptlets like this:
+		%post -p /sbin/ldconfig
+		%postun -p /sbin/ldconfig
+	(or the equivalent within a scriptlet body).
+
+	On upgrade, with install before erase, this results in 2 executions of /sbin/ldconfig.
+
+	One of those invocations is redundant when a library is being replaced, the
+	install %post is sufficient to make the library avaialble for loading.
+
+	The redundant invocation of /sbin/ldconfig  was deemed a performance flaw @redhat,
+	where I was asked to implement the current optimization.
+
+	So the RPM optimization detects when /sbin/ldconfig has just been run, and skips the next
+		%scriptlet -p /sbin/ldconfig
+	(when written exactly like that) if /sbin/ldconfig has been executed.
+
+	Issues are only seen when a scriptlet contains an executable that needs
+	a changed API: this is usually a very rare occurrence
+
+	There are other flaws with the optimization when dependency loops break the sorted order
+	(and/or --noorder is used). , and the fix of running /sbin/ldconfig manually is rather simple
+	(even if the problem is obscure).
+
+	There is another flaw (as in your report), when the very last package
+	has a pending skipped /sbin/ldconfig invocation.
+
+	The fix of running /sbin/ldconfig manually is rather simple
+	(even if the problem is obscure).
+
+hth
+
+73 de Jeff
+===================================================================
+RCS file: /v/rpm/cvs/rpm/lib/psm.c,v
+retrieving revision 2.399.2.20
+diff -p -u -w -r2.399.2.20 psm.c
+--- ./lib/psm.c	11 May 2015 21:10:16 -0000	2.399.2.20
++++ ./lib/psm.c	31 May 2016 15:19:20 -0000
+@@ -800,7 +800,7 @@ static rpmRC runEmbeddedScript(rpmpsm ps
+ static int ldconfig_done = 0;
+ 
+ /*@unchecked@*/ /*@observer@*/ /*@null@*/
+-static const char * ldconfig_path = "/sbin/ldconfig";
++static const char * ldconfig_path = NULL;
+ 
+ /**
+  * Run scriptlet with args.
+
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/8c28fc02688ea15524dc143d1d0df4a8bf4e3287



More information about the pld-cvs-commit mailing list