39
Chapter 6
Package maintainer scripts and
installation procedure
6.1 Introduction to package maintainer scripts
It is possible to supply scripts as part of a package which the package management system will
run for you when your package is installed, upgraded or removed.
These scripts are the files
preinst
,
postinst
,
prerm
and
postrm
in the control area of the
package. They must be proper executable files; if they are scripts (which is recommended),
they must start with the usual
#!
convention. They should be readable and executable by
anyone, and not world writable.
The package management system looks at the exit status from these scripts. It is important that
they exit with a non zero status if there is an error, so that the package management system
can stop its processing. For shell scripts this means that you almost always need to use
set  e
(this is usually true when writing shell scripts, in fact). It is also important, of course, that they
don't exit with a non zero status if everything went well.
When a package is upgraded a combination of the scripts from the old and new packages is
called during the upgrade procedure. If your scripts are going to be at all complicated you
need to be aware of this, and may need to check the arguments to your scripts.
Broadly speaking the
preinst
is called before (a particular version of) a package is installed,
and the
postinst
afterwards; the
prerm
before (a version of) a package is removed and the
postrm
afterwards.
Programs called from maintainer scripts should not normally have a path prepended to them.
Before installation is started, the package management system checks to see if the programs
ldconfig
,
start stop daemon
,
install info
, and
update rc.d
can be found via the
PATH
environment variable. Those programs, and any other program that one would expect
to be on the
PATH
, should thus be invoked without an absolute pathname. Maintainer scripts
should also not reset the
PATH
, though they might choose to modify it by prepending or ap 
pending package specific directories. These considerations really apply to all shell scripts.






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