[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#27433: [PROPOSAL]: ldconfig in postinst



Package: debian-policy
Version: 2.4.1

As specified in policy, packages with shared libs generally run "ldconfig"
from "postinst configure".

When I removed the last of the libc5-based libraries from my system,
/usr/lib/libc5-compat and /lib/libc5-compat were removed by dpkg, because
no package needed them any more.  However, they didn't get removed from
/etc/ld.so.conf, which means that whenever I configure a shlib package,
ldconfig gives warnings about the missing directories.

Now, of course it's easy to fix this by editing /etc/ld.so.conf, but
I read the man page for ldconfig just now and found this: if you know
which directory needs updating, "ldconfig -n <dir>" updates just that
one directory.  Specifically, it gives no warnings for nonexistant
directories in /etc/ld.so.conf.

Thus, I'd like to suggest that packages containing shared libraries
should use "ldconfig -n <dir>" in order to limit the number of useless
warnings the user sees; ISTR that policy already says to limit the output
from maintainer scripts to that which is absolutely necessary.

A possible problem: how recently was -n first supported by ldconfig?
If less that a couple of years, it might be better to avoid this.

I suggest the following wpatch[1] to the policy manual:

   2.3.8 Maintainer scripts

   The package installation scripts should avoid producing output which
   it is unnecessary for the user to see and should rely on dpkg to
   stave off boredom on the part of a user installing many packages. This
   means, amongst other things, using the --quiet option on install-info.
   {+Because the libc5-to-libc6 transition will have left some machines
   with ld.so.conf entries for directories which no longer exist,
   this also means using the -n option on ldconfig to specify a single
   directory to update, and thus avoid some harmless warnings (this also
   speeds up processing slightly).+}


(There's also another possibility, which is to give the exact names of
each library contained in the package on the ldconfig command line.)

[The other thing that really needs doing sometime is to implement the
 --quiet and --verbose options on update-alternatives, and to make it
 quiet(er) by default.  Ideally, it should output at most a single line
 per invocation, and, I think, only when something unusual happens.
 (Merely changing an alternative which is in automatic mode isn't
 unusual, IMO.)  With the present setup, and even with the tall, 67-line
 windows I normally use, it's easy for a package like jdk1.1, which has
 lots of alternatives to install, to cause the (usually more important)
 output from all the previous packages to scroll away, so that I don't
 get a chance to read it.  But that has nothing to do with the ldconfig
 proposal...]


[1] The output from wdiff, as distinct from "normal" patch output from
    diff.  For those unfamiliar with wdiff, {+ ... +} indicates additions,
    [- ... -] indicates deletions.

-- 
Charles Briscoe-Smith
White pages entry, with PGP key: <URL:http://alethea.ukc.ac.uk/wp?95cpb4>
PGP public keyprint: 74 68 AB 2E 1C 60 22 94  B8 21 2D 01 DE 66 13 E2


Reply to: