Chapter 8. Shared libraries
54
at once (so that you don't get filename clashes if you try to install different versions of the
combined shared libraries package).
The package should install the shared libraries under their normal names. For example, the
libgdbm3
package should install
libgdbm.so.3.0.0
as
/usr/lib/libgdbm.so.3.0.0
.
The files should not be renamed or re linked by any
prerm
or
postrm
scripts;
dpkg
will take
care of renaming things safely without affecting running programs, and attempts to interfere
with this are likely to lead to problems.
Shared libraries should not be installed executable, since the dynamic linker does not require
this and trying to execute a shared library usually results in a core dump.
The run time library package should include the symbolic link that
ldconfig
would create
for the shared libraries. For example, the
libgdbm3
package should include a symbolic link
from
/usr/lib/libgdbm.so.3
to
libgdbm.so.3.0.0
. This is needed so that the dynamic
linker (for example
ld.so
or
ld linux.so.*
) can find the library between the time that
dpkg
installs it and the time that
ldconfig
is run in the
postinst
script.
3
8.1.1
ldconfig
Any package installing shared libraries in one of the default library directories of the dy 
namic linker (which are currently
/usr/lib
and
/lib
) or a directory that is listed in
/etc
/ld.so.conf
4
must use
ldconfig
to update the shared library system.
The package must call
ldconfig
in the
postinst
script if the first argument is
configure
;
the
postinst
script may optionally invoke
ldconfig
at other times. The package should call
ldconfig
in the
postrm
script if the first argument is
remove
. The maintainer scripts must
not invoke
ldconfig
under any circumstances other than those described in this paragraph.
5
3
The package management system requires the library to be placed before the symbolic link pointing to it in
the
.deb
file. This is so that when
dpkg
comes to install the symlink (overwriting the previous symlink pointing at
an older version of the library), the new shared library is already in place. In the past, this was achieved by creating
the library in the temporary packaging directory before creating the symlink. Unfortunately, this was not always
effective, since the building of the tar file in the
.deb
depended on the behavior of the underlying file system. Some
file systems (such as reiserfs) reorder the files so that the order of creation is forgotten. Since version 1.7.0,
dpkg
reorders the files itself as necessary when building a package. Thus it is no longer important to concern oneself
with the order of file creation.
4
These are currently
  /usr/X11R6/lib/Xaw3d
  /usr/local/lib
  /usr/lib/libc5 compat
  /lib/libc5 compat
  /usr/X11R6/lib
5
During install or upgrade, the preinst is called before the new files are installed, so calling  ldconfig  is point 
less. The preinst of an existing package can also be called if an upgrade fails. However, this happens during the
critical time when a shared libs may exist on disk under a temporary name. Thus, it is dangerous and forbidden by
current policy to call  ldconfig  at this time. When a package is installed or upgraded,  postinst configure  runs
after the new files are safely on disk. Since it is perfectly safe to invoke ldconfig unconditionally in a postinst, it is
OK for a package to simply put ldconfig in its postinst without checking the argument. The postinst can also be
called to recover from a failed upgrade. This happens before any new files are unpacked, so there is no reason to






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

gay web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved