Debhelper-generated postinst and prerm vs. manual one

Roberto C. Sanchez roberto at connexer.com
Wed Oct 18 14:35:47 UTC 2006


On Wed, Oct 18, 2006 at 04:28:56PM +0300, Fabian Fagerholm wrote:
> On Wed, 2006-10-18 at 09:42 -0300, Henrique de Moraes Holschuh wrote:
> > Does the initscript uses this variable for something?
> 
> Yes, it prevents the initscript from failing with a non-zero error code
> for the following reasons:
>       * Package not installed (how clever is this?).
>       * Daemon not enabled in /etc/default/saslauthd.
>       * No mechs defined in /etc/default/saslauthd.
> 
> So if MAINTSCRIPT=yes, it exits with 0 in the above cases.
> 
> The init script that I committed a few months back is just a rough draft
> which outlines an LSB-compliant script. It needs work.
> 
> But your question is correct, we need to first consider the initscript
> and then decide on the dh_installinit question. Thanks for asking the
> right question! :)
> 

I used the MAINTSCRIPT variable to solve bug #257181 while still being
able to exit with zero if it is called by dpkg.  The default behavior
when installing something with an init script is to have dpkg call
"invoke-rc.d foo start" after installing it.  If you exit with a
non-zero, this causes dpkg to fail to complete the install, or at least
causes a scary warning to the user.  However, in the event of a script
that an admin writes, you don't want "invoke-rc.d foo start" to not
start the daemon and then exit with a zero.  The scheme I cooked up is
designed precisely to deal with the fact the you want dpkg to get a zero
exit code on install/upgrade/reinstall/remove/purge/whatever whether or
not the daemon is started (in our case because START=yes may not be set
in /etc/defaults/saslauthd), yet you want the exit code to be useful for
admins who script things.

Regards,

-Roberto
-- 
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-cyrus-sasl2-debian-devel/attachments/20061018/0cf2f0df/attachment.pgp


More information about the Pkg-cyrus-sasl2-debian-devel mailing list