Your message dated Tue, 22 Jul 2008 15:14:52 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Re: Bug#447609: ldconfig triggerisation
has caused the Debian Bug report #447609,
regarding ldconfig triggerisation
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
447609: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447609
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Source: glibc
Version: 2.6.1-6
Severity: wishlist
Tags: patch

The attached patch triggerises the invocation of ldconfig by package
maintainer scripts.

By `triggerises' I mean that the patch arranges for ldconfig
invocations by maintainer scripts to call dpkg-trigger instead of
ldconfig.  ldconfig will be actually run out of glibc's maintainer
script during trigger processing.  The consequence is that all of the
ldconfig invocations during a dpkg run are deferred, and instead
ldconfig is run once at the end.

The understanding on which we base this approach is that after library
installation (which is when ldconfig is used in maintainer scripts) it
is always safe to defer the execution of ldconfig.  Ie, that after a
new library has been installed or an existing library upgraded,
programs which link against the library will work even though ldconfig
hasn't been run.  We understand that not running ldconfig will incur
some performance penalty during the upgrade process but in practice
this is far outweighed by the cost of repeatedly running ldconfig.

We took the approach of renaming ldconfig to ldconfig.real and
replacing it with a wrapper script.  This is unfortunately necessary
because maintainer scripts are in the habit of calling ldconfig
directly.  An alternative approach would be to change all of the
packages not to call ldconfig but instead to call a new script but
this would involve a much more complicated and lengthy transition.

The patch is safe to use with a non-triggers-supporting dpkg and in
all transitional states: where the trigger system is not properly set
up yet, ldconfig is run as normal.  Note that sid's dpkg does not yet
have the triggers patch merged but there has been extensive discussion
of the design and interfaces for triggers and the API should IMO be
considered stable.

These changes have been tested and released as part of Ubuntu 7.10 aka
`gutsy gibbon'.  The patch below is the consilidation of the results
of our testing.

So we believe that this patch can and should be safely applied to
sid's glibc straight away.

Ian.

diff --exclude='*.orig' -ruN orig/glibc-2.6.1/debian/debhelper.in/libc.postinst 
glibc-2.6.1/debian/debhelper.in/libc.postinst
--- orig/glibc-2.6.1/debian/debhelper.in/libc.postinst  2007-10-22 
15:40:11.000000000 +0100
+++ glibc-2.6.1/debian/debhelper.in/libc.postinst       2007-10-22 
15:38:11.000000000 +0100
@@ -5,6 +5,15 @@
 type=$1
 preversion=$2
 
+if [ "x$type" = xtriggered ]
+then
+       LDCONFIG_NOTRIGGER=y
+       export LDCONFIG_NOTRIGGER
+       echo ldconfig deferred processing now taking place
+       ldconfig
+       exit 0
+fi
+
 package_name()
 {
     echo LIBC
diff --exclude='*.orig' -ruN orig/glibc-2.6.1/debian/debhelper.in/libc.triggers 
glibc-2.6.1/debian/debhelper.in/libc.triggers
--- orig/glibc-2.6.1/debian/debhelper.in/libc.triggers  1970-01-01 
01:00:00.000000000 +0100
+++ glibc-2.6.1/debian/debhelper.in/libc.triggers       2007-10-22 
15:38:11.000000000 +0100
@@ -0,0 +1 @@
+interest ldconfig
diff --exclude='*.orig' -ruN orig/glibc-2.6.1/debian/local/ldconfig_wrap 
glibc-2.6.1/debian/local/ldconfig_wrap
--- orig/glibc-2.6.1/debian/local/ldconfig_wrap 1970-01-01 01:00:00.000000000 
+0100
+++ glibc-2.6.1/debian/local/ldconfig_wrap      2007-10-22 15:39:01.000000000 
+0100
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if  test $# = 0                                                        \
+    && test x"$LDCONFIG_NOTRIGGER" = x                         \
+ && test x"$DPKG_MAINTSCRIPT_PACKAGE" != x                     \
+ && dpkg-trigger --check-supported 2>/dev/null                 \
+ && dpkg --compare-versions "$DPKG_RUNNING_VERSION" ge '1.14.5ubuntu10~~'
+then
+       if dpkg-trigger --no-await ldconfig; then
+               if test x"$LDCONFIG_TRIGGER_DEBUG" != x; then
+                       echo "ldconfig: wrapper deferring update (trigger 
activated)"
+               fi
+               exit 0
+       fi      
+fi
+
+exec /sbin/ldconfig.real "$@"
diff --exclude='*.orig' -ruN orig/glibc-2.6.1/debian/rules.d/debhelper.mk 
glibc-2.6.1/debian/rules.d/debhelper.mk
--- orig/glibc-2.6.1/debian/rules.d/debhelper.mk        2007-10-22 
15:40:11.000000000 +0100
+++ glibc-2.6.1/debian/rules.d/debhelper.mk     2007-10-22 15:38:11.000000000 
+0100
@@ -59,6 +59,13 @@
            dh_install -p$(curpass) debian/bug/$(curpass) usr/share/bug; \
        fi
 
+       set -ex; case $(curpass) in libc6|libc6.1) \
+               mv debian/$(curpass)/sbin/ldconfig \
+                       debian/$(curpass)/sbin/ldconfig.real; \
+               install -m755 -o0 -g0 debian/local/ldconfig_wrap \
+                       debian/$(curpass)/sbin/ldconfig; \
+               ;; esac
+
        # extra_debhelper_pkg_install is used for debhelper.mk only.
        # when you want to install extra packages, use extra_pkg_install.
        $(call xx,extra_debhelper_pkg_install)
@@ -118,6 +125,11 @@
                        
debian/$(curpass)/usr/share/lintian/overrides/$(curpass) ; \
        fi
 
+       if [ -f debian/$(curpass).triggers ] ; then \
+               install -m 644 -o root -g root debian/$(curpass).triggers \
+                       debian/$(curpass)/DEBIAN/triggers ; \
+       fi
+
        if [ -f debian/$(curpass).linda ] ; then \
                install -d -m 755 -o root -g root 
debian/$(curpass)/usr/share/linda/overrides/ ; \
                install -m 644 -o root -g root debian/$(curpass).linda \

--- End Message ---
--- Begin Message ---
Version: 2.7-1

Since version 2.7-1, ldconfig includes a second level cache, which makes
calls to ldconfig very cheap, and only looks at the newer libraries.

I see that as another way to improve the speed of packages
installation, and more safer than ldconfig triggerisation.

I am therefore closing this bug.

-- 
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [EMAIL PROTECTED]         | [EMAIL PROTECTED]
   `-    people.debian.org/~aurel32 | www.aurel32.net


--- End Message ---

Reply via email to